fork download
  1. #include <stdio.h>
  2. main
  3.  
  4. {
  5. int a;/*投入金額*/
  6. int b=110/a;/*買える本数*/
  7. int c; /*買える本数*/
  8.  
  9. printf("お金を投入して下さい。¥n");
  10. scanf("%d",a);
  11.  
  12. if(b==0)
  13. printf("1本も買えません。");
  14. else if(b=1)
  15. printf("ちょうど1本買えます。¥n");
  16. else if(b>1)
  17. printf("%d本分買えます。何本買いますか。¥n");
  18. scanf("%d",&c);
  19. if(c<=b)
  20. printf("飲み物が%d本出ます。おつりは%d円です。",c,a-110*c);
  21. else
  22. printf("%d本までしか買えません。%d円不足しています。",b,-(110*c-a));
  23.  
  24.  
  25.  
  26. }
Compilation error #stdin compilation error #stdout 0s 4420KB
stdin
Standard input is empty
compilation info
prog.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
stdout
Standard output is empty