importerror
2018-10-06 19:07
hello.c: In function 'main': hello.c:57:74: error: stray '\357' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:75: error: stray '\274' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:76: error: stray '\214' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:77: error: expected ')' before 'year' printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^~~~ hello.c:57:22: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:27: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:32: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:57:67: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:74: error: stray '\357' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:75: error: stray '\274' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:76: error: stray '\214' in program printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:77: error: expected ')' before 'year' printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^~~~ hello.c:62:22: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:27: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:32: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^ hello.c:62:67: warning: format '%d' expects a matching 'int' argument [-Wformat=] printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum); ^
原代码:
if ((year%4 == 0 && year%100 != 0) || year%400 == 0)
{
sum =sum + 1 + day;
printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum);
②
else
{
sum =sum + day;
printf("%d年%d月%d日这一天,是该年中的第%d天\n",year,month,day,sum);
}
}①
直接把①移到了②,然后报错,想知道原因
C语言入门
926023 学习 · 20793 问题
相似问题
回答 1
回答 3
回答 2
回答 2
回答 3