#include <stdio.h>
int isLeapYear(int y){
if(y%400==0) return 1;
if(y%100==0) return 0;
if(y%4==0) return 1;
return 0;
}
int main(){
int y;
printf("西暦を入力してください\n");scanf("%d",&y);
if(isLeapYear(y)) printf("この年は閏年です");
else printf("この年は閏年ではありません");
}
To embed this project on your website, copy the following code and paste it into your website's HTML: