早教吧作业答案频道 -->其他-->
errorC2018:unknowncharacter'0xac'#include"stdio.h"structdate{intyear;intmonth;intday;}dat={0,0,0};/*对结构体变量赋初值*/voidmain(){intyear,month,day;intx;intdays(int,int,int);scanf("%d,%d,%d",&year,&month,&d
题目详情
errorC2018:unknowncharacter'0xac'#include"stdio.h" structdate { intyear; intmonth; intday; }dat={0,0,0};/*对结构体变量赋初值*/ voidmain() { intyear,month,day; intx; intdays(int,int,int); scanf("%d,%d,%d",&year,&month,&day); x=days(year,month,day); printf("%d年%d月%d日在本年中是第%d天。",year,month,day,x); } intdays(intdat.year,intdat.month,intdat.day) {intmonth[12]; inti,intsum; if(dat.year%4==0&&dat.year%100==0||dat.year%400==0) month[12]={31,29,31,30,31,30,31,31,30,31,30,31}; else month[12]={31,28,31,30,31,30,31,31,30,31,30,31}; for(i=0;i<dat.month;i++) sum=sum+month[i]; return(sum); } 错误信息 xiti111.c E:\c\zuoye\xiti111\xiti111.c(20):errorC2143:syntaxerror:missing')'before'.' E:\c\zuoye\xiti111\xiti111.c(20):errorC2143:syntaxerror:missing'{'before'.' E:\c\zuoye\xiti111\xiti111.c(20):errorC2059:syntaxerror:'.' character'0xa3' E:\c\zuoye\xiti111\xiti111.c(24):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(24):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(24):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(24):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xa3' E:\c\zuoye\xiti111\xiti111.c(26):errorC2018:unknowncharacter'0xac' Errorexecutingcl.exe.
▼优质解答
答案和解析
主要是逗号全角的问题,改成半角就行了 ==================================== #include"stdio.h" structdate { intyear; intmonth; intday; }dat={0,0,0};/*对结构体变量赋初值*/ voidmain() { intyear,month,day; intx; intdays(int,int,int); scanf("%d,%d,%d",&year,&month,&day); x=days(year,month,day); printf("%d年%d月%d日在本年中是第%d天。",year,month,day,x); } intdays(intdatyear,intdatmonth,intdatday) { inti,sum; if(datyear%4==0&&datyear%100==0||datyear%400==0) { intmonth[12]={31,29,31,30,31,30,31,31,30,31,30,31}; for(i=0;i
看了 errorC2018:unk...的网友还看了以下:
errorC2018:unknowncharacter'0xac'#include"stdio.h 2020-07-23 …