fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5. int a,b,c,d;
  6.  
  7. scanf("%d",&a);
  8.  
  9. if(a<0)
  10. { printf("正しい金額を入力してください");
  11.  
  12. return 0;
  13. }
  14.  
  15. if(a<5000)
  16. {
  17. b=a+100;
  18.  
  19. printf("%d円の支払いです",b); }
  20. else if(5000<=a && a<10000)
  21. {
  22. c=a+200;
  23. printf("%d円の支払いです",c);
  24. }
  25. else if(10000<=a)
  26. {
  27. d=a+300;
  28. printf("%d円の支払いです",d);
  29. }
  30. else if(a<0)
  31. { printf("%d正しい金額を入力してください"); }
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 5324KB
stdin
6000
stdout
6200円の支払いです