syntax error
来源:百度知道 编辑:UC知道 时间:2024/05/25 01:36:48
#include <stdio.h>
void main()
{
float sum,t;
int m,year;
printf("\nplease input m,year\n");
scanf("%d,%d",&m,&year);
switch(year)
{
case 1:t=0.63%;break;
case 2:t=0.66%;break;
case 3:t=0.69%;break;
case 5:t=0.75%;break;
case 8:t=0.84%;break;
default:printf("data error\n");break;
}
sum=m+m*t*12*year;
printf("The money is %f\n",sum);
}
Compiling...
wan.c
D:\Backup\wan.c(10) : error C2059: syntax error : ';'
D:\Backup\wan.c(11) : error C2059: syntax error : ';'
D:\Backup\wan.c(12) : error C2059: syntax error : ';'
D:\Backup\wan.c(13) : error C2059: syntax error : ';'
D:\Backup\wan.c(14) : error C2059: syntax error : ';'
执行 cl.exe 时出错.
拜托了 各位
void main()
{
float sum,t;
int m,year;
printf("\nplease input m,year\n");
scanf("%d,%d",&m,&year);
switch(year)
{
case 1:t=0.63%;break;
case 2:t=0.66%;break;
case 3:t=0.69%;break;
case 5:t=0.75%;break;
case 8:t=0.84%;break;
default:printf("data error\n");break;
}
sum=m+m*t*12*year;
printf("The money is %f\n",sum);
}
Compiling...
wan.c
D:\Backup\wan.c(10) : error C2059: syntax error : ';'
D:\Backup\wan.c(11) : error C2059: syntax error : ';'
D:\Backup\wan.c(12) : error C2059: syntax error : ';'
D:\Backup\wan.c(13) : error C2059: syntax error : ';'
D:\Backup\wan.c(14) : error C2059: syntax error : ';'
执行 cl.exe 时出错.
拜托了 各位
case 1:t=0.63%;break;
case 2:t=0.66%;break;
case 3:t=0.69%;break;
case 5:t=0.75%;break;
case 8:t=0.84%;break;
default:printf("data error\n");break;
case 1:t=0.0063;break;
case 2:t=0.0066;break;
case 3:t=0.0069;break;
case 5:t=0.0075;break;
case 8:t=0.0084;break;
default:printf("data error\n");break;
你是不是用汉字输入模式下的';'
% 作为模运算符号了
不再是百分号,所以这个你自己可以规避1下
declaration syntax error
Declaration syntax Error
C语言declaration syntax error
PHP syntax error,unexpected T_ECHO
error C2059: syntax error : 'switch'
syntax error runtime error和logic error 的区别(java)
倾家荡产求助:“C语言 declaration syntax error”
Declaration syntax error in function main
错误代码:500;错误信息:500 Error: bad syntax
declaration syntax error in function volume