error C2018: unknown character '0xa3'
F:\新建文件夹\11.cpp(6) : error C2018: unknown character '0xba'
F:\新建文件夹\11.cpp(14) : error C2181: illegal else without matching if
F:\新建文件夹\11.cpp(20) : error C2181: illegal else without matching if
执行 cl.exe 时出错.
编程如下
#include<stdio.h>
void main()
{
float y,z;
int x;
printf("请输入产品号与件数":);
scanf ("%d%f",&x,&y);
switch(x)
{
case 1:printf("z=2.5*y\n",&z);break;
case 2:
if(y>10)
printf("z=12.8*0.9*y",&z);break;
else
printf("z=12.8*y",&z);break;
case 3:
if(y>20)
printf("z=4.8*0.8*y",&z);break;
else printf("z=4.8*y",&z);break;
}
}
大神 我已经私信你了
追答回答了