fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5.  
  6. int year = 0;
  7. int yun;
  8.  
  9. printf("윤년 구하기\n년도를 입력해 주세요.(4자리 숫자만 입력): ");
  10. scanf_s("%d", &year);
  11.  
  12. bool rst = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
  13.  
  14. const char* tr = "%d년은 윤년입니다!";
  15. const char* fa = "%d년은 평년입니다!";
  16.  
  17. printf(rst ? tr : fa, year);
  18. return 0;
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:2: warning: implicit declaration of function ‘scanf_s’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
  scanf_s("%d", &year);
  ^~~~~~~
  scanf
prog.c:12:2: error: unknown type name ‘bool’; did you mean ‘_Bool’?
  bool rst = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
  ^~~~
  _Bool
prog.c:7:6: warning: unused variable ‘yun’ [-Wunused-variable]
  int yun;
      ^~~
stdout
Standard output is empty