用vs2013编c程序出现错误求教.................................................
编了一个程序用来判断所输入的日子是这一年的第几天。代码如下:#include<stdio.h>
int main()
{
int pdprn(int x);
int year,month,day,ts=0,n=0;
int sum[11] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 };
int sumr[11] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30 };
printf("请输入年月日。(格式:****年**月**日)\n");
scanf_s("%d年%d月%d日",&year,&month,&day);
if (month <= 1)
{
ts = day;
printf("%d年%d月%d日是%d年的第%d天。\n",year,month,day,year,ts);
}
else if (pdprn(year) == 0)
{
while (n <= month - 2)
ts = ts + sumr[n++];
ts = ts + day;
printf("%d年%d月%d日是%d年的第%d天。\n",year,month,day,year,ts);
}
else
{
while (n <= month - 2)
ts = ts + sum[n++];
ts = ts + day ;
printf("%d年%d月%d日是%d年的第%d天。\n",year,month,day,year,ts);
}
return 0;
}
int pdprn(int x)
{
if (x % 100 == 0)
{
if (x % 400 == 0)
return 0;
else
return 1;
}
else if (x % 4 == 0)
return 0;
else
return 1;
}
运行后会报错
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
这两个错误,问题出到哪了??