fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. { int money,result;
  5.  
  6. scanf("%d",&money);
  7.  
  8. if(0>=money)
  9. { printf("正しい金額を入力してください。"); }
  10.  
  11. else if(money<5000)
  12. { result=money+100;
  13. printf("%d円の支払いです。",result); }
  14.  
  15. else if(5000<=money && money<10000)
  16. { result=money+200;
  17. printf("%d円の支払いです。",result); }
  18.  
  19. else if(10000<=money)
  20. { result=money+300;
  21. printf("%d円の支払いです。",result); }
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5312KB
stdin
15000
stdout
15300円の支払いです。