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