switch(month)
{
case 2:
days = 28;break;
case 4 :csae 6:case 9:case 11:
days = 30;break;
default:
days =31;break;
}
prntf("%d天\n", days)
提示:
--------------------Configuration: HN2 - Win32 Debug--------------------
Compiling...
HN2.c
c:\users\1\desktop\c语言学习\hn2.c(1) : error C2059: syntax error : 'switch'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2143: syntax error : missing ')' before 'string'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2143: syntax error : missing '{' before 'string'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2059: syntax error : '<Unknown>'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2059: syntax error : ')'
执行 cl.exe 时出错.
HN2.obj - 1 error(s), 0 warning(s
你前面有没有
#include
int main()
{
int month,day;
scanf("%d",&month);
这个,要是有的话,不是语句的问题,应该是中英文符号转化,
c:\users\1\desktop\c语言学习\hn2.c(1) : error C2059: syntax error : 'switch'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2143: syntax error : missing ')' before 'string'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2143: syntax error : missing '{' before 'string'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2059: syntax error : '<Unknown>'
c:\users\1\desktop\c语言学习\hn2.c(10) : error C2059: syntax error : ')'
执行 cl.exe 时出错.
HN2.obj - 1 error(s), 0 warning(s上面这些是错误,你在上面几行中选中其中一行,双击就找到错误地方了