#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; }
原文地址:http://10740329.blog.51cto.com/10730329/1703935