fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. const int FREEZING = 0;
  6. float temperature;
  7. int cold_days = 0;
  8. int all_days = 0;
  9.  
  10. printf("최저 기온들의 목록을 입력하시오.\n");
  11. printf("섭씨 단위를 사용하시오.(입력을 끝내려면 q)\n");
  12.  
  13. while(scanf("%f,&temperature) == 1)
  14. {
  15. all_day++;
  16. if(temperature < FREEZING)
  17. cold_days++;
  18. }
  19.  
  20. if(all_days !=0)
  21. printf("전체 %d일 중에 영하의 날씨는 %.1f%%였습니다.\n",
  22. all_days, 100.0 * (float) cold_days / all_days);
  23. if(all_days == 0)
  24. printf("입력 데이터가 없습니다.\n");
  25.  
  26.  
  27.  
  28. return 0;
  29.  
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:13:14: warning: missing terminating " character
  while(scanf("%f,&temperature) == 1)
              ^
prog.c:13:14: error: missing terminating " character
  while(scanf("%f,&temperature) == 1)
              ^~~~~~~~~~~~~~~~~~~~~~~
prog.c:14:3: error: expected expression before ‘{’ token
   {
   ^
prog.c:30:1: error: expected ‘)’ before ‘}’ token
 }
 ^
prog.c:30:1: error: expected expression before ‘}’ token
prog.c:8:6: warning: unused variable ‘all_days’ [-Wunused-variable]
  int all_days = 0;
      ^~~~~~~~
prog.c:7:6: warning: unused variable ‘cold_days’ [-Wunused-variable]
  int cold_days = 0;
      ^~~~~~~~~
prog.c:6:8: warning: unused variable ‘temperature’ [-Wunused-variable]
  float temperature;
        ^~~~~~~~~~~
prog.c:5:12: warning: unused variable ‘FREEZING’ [-Wunused-variable]
  const int FREEZING = 0;
            ^~~~~~~~
stdout
Standard output is empty