主要是逗号全角的问题,改成半角就行了
====================================
#include"stdio.h"
struct date
{
int year;
int month;
int day;
}dat={0,0,0}; /*对结构体变量赋初值 */
void main()
{
int year,month,day;
int x;
int days(int,int,int);
scanf("%d,%d,%d",&year,&month,&day);
x=days(year,month,day);
printf("%d年%d月%d日在本年中是第%d天。",year,month,day,x);
}
int days(int datyear,int datmonth,int datday)
{
int i,sum;
if(datyear%4==0&&datyear%100==0||datyear%400==0)
{
int month[12]={31,29,31,30,31,30,31,31,30,31,30,31};
for(i=0;i
}
else
{
int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
for(i=0;i
}
return (sum);
}