#include
#include
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int leap(int a);
int number(int year,int m ,int d);
int main(int argc, char *argv[]) {
int year, month,day,n;
printf("请输入年月日\n");
//sacanf("%d,%d,%d",&year,&month,&day);
sacanf("%d,%d,%d",&year,&month,&day);
n=number(year,month,day);
if((n%5)0)
printf("%d%d%d 打渔\n",year,month,day);
else
printf("%d%d%d 嗮网\n",year,month,day);
return 0;
}
int leap(int a){
if(a%4==0 && a%100!=0 || a%400==0)
return 1;
else
return 0;
}
int number(int year,int m ,int d){
int sum=0,i,j;
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int b[12]={31,29,31,30,31,30,31,31,30,31,30,31};
if(leap(year==1))
for(i=0;i<m-1;i++)
sum+=b[i];
else
for(i=0;i<m-1;i++)
sum+=a[i];
for(j=2011;j<year;j++)
if(leap(j)==1)
sum+=366;
else
sum+=365;
sum+=d;
return sum;
}
网上查过是链接问题。。。 怎么改回去?