C
윤년&평년 구하기
switch_user
2020. 9. 14. 22:10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <stdio.h>
int main(){
int year;
printf("Enter a year.\n");
scanf("%d", &year);
if (((year % 4 == 0)&&(year % 100 != 0))||(year % 400 == 0)){
printf("It is a leap year.\n");
}
else{
printf("It is not a leap year.\n");
}
return 0;
}
|
cs |