Recent Posts
printf("ho_tari\n");
isLeap 본문
#include <stdio.h>
int main(void)
{
int year;
scanf("%d", &year);
int isLeap = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0);
//int isLeap = (year % 400 == 0 || year % 4 == 0 && year % 100 != 0);
printf("%d is leap : %d\n", year, isLeap);
return 0;
}
<compile 결과>
'C' 카테고리의 다른 글
letterAttribute (0) | 2023.09.01 |
---|---|
isOrdinary (0) | 2023.09.01 |
incrementor (0) | 2023.09.01 |
isAlphabet (0) | 2023.09.01 |
genderRatio (0) | 2023.09.01 |