练习题目5. 从键盘输入年份,判断是不是闰年,如果是,输出是闰年。

来源:互联网 发布:淘宝达人号出售 编辑:程序博客网 时间:2024/04/29 23:56
#include<stdio.h>
int main(int argc, char* argv[])
{
   int a;
   printf("please input a year:");
   scanf("%d",&a);
   fflush(stdin);

   if(a%4==0 && a%100 !=0 || a%400 ==0)
     printf("the %d is run nian\n",a);
   else
     printf("the %d id not run nian",a);
}
0 0
原创粉丝点击