文章
94
粉丝
0
获赞
19
访问
2.7k
每个条件都要看到
#include<stdio.h>
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int fun(int x){
if(x%4==0&&x%100!=0||x%400==0)
{
return 1;
}
return 0;
}
int main()
{
int y,m,d;
while(scanf("%d %d %d",&y,&m,&d)!=EOF)
{
if(m<1||m>12){
printf("Input error!\n");
continue;
}
if(d<0||d>a[m])
{
printf("Input error!\n");
continue;
}
&n...
登录后发布评论
暂无评论,来抢沙发