C
isLeap
호타리
2023. 9. 1. 09:32
#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 결과>