#include<stdio.h> int leap(int year) { if((year%4==0)&&(year%100!=0)||(year%400==0)) { return 1; } else { return 0; } } int main() { int year; int ret; scanf("%d",&year); ret=leap(year); if(ret==1) { printf("%d is a leap year;",year); } else { printf("%d is not a leap year;",year); } return 0; }
时间: 2024-10-08 11:13:22