#includevoid main(){double p,w,a,d,f;scanf("%lf %lf %lf",&p,
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/10 11:17:29
#include
void main()
{
double p,w,a,d,f;
scanf("%lf %lf %lf",&p,&w,&a);
{
if a>=3000 d=15;
else if a>=2000 d=10;
else if a>=1000 d=8;
else if a>=500 d=5;
else if a>=250 d=2;
else d=0;
}
f=p*w*a*(1-d/100);
printf("%lf",f);
}
--------------------Configuration:r1 - Win32 Debug--------------------
Compiling...
r1.cpp
D:\试练\r1.cpp(7) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(8) :error C2181:illegal else without matching if
D:\试练\r1.cpp(8) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(9) :error C2181:illegal else without matching if
D:\试练\r1.cpp(9) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(10) :error C2181:illegal else without matching if
D:\试练\r1.cpp(10) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(11) :error C2181:illegal else without matching if
D:\试练\r1.cpp(11) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(12) :error C2181:illegal else without matching if
执行 cl.exe 时出错.
r1.obj - 1 error(s),0 warning(s)
这是怎么了?
void main()
{
double p,w,a,d,f;
scanf("%lf %lf %lf",&p,&w,&a);
{
if a>=3000 d=15;
else if a>=2000 d=10;
else if a>=1000 d=8;
else if a>=500 d=5;
else if a>=250 d=2;
else d=0;
}
f=p*w*a*(1-d/100);
printf("%lf",f);
}
--------------------Configuration:r1 - Win32 Debug--------------------
Compiling...
r1.cpp
D:\试练\r1.cpp(7) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(8) :error C2181:illegal else without matching if
D:\试练\r1.cpp(8) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(9) :error C2181:illegal else without matching if
D:\试练\r1.cpp(9) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(10) :error C2181:illegal else without matching if
D:\试练\r1.cpp(10) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(11) :error C2181:illegal else without matching if
D:\试练\r1.cpp(11) :error C2061:syntax error :identifier 'a'
D:\试练\r1.cpp(12) :error C2181:illegal else without matching if
执行 cl.exe 时出错.
r1.obj - 1 error(s),0 warning(s)
这是怎么了?
if a>=3000 改成 if (a>=3000),后面的if都要改.
#includevoid main(){double p,w,a,d,f;scanf("%lf %lf %lf",&p,
#include main() { double a,b,c,d,e; scantf("lf%lf%lf%",a,b,c
scanf("%lf",&a)
%.lf%%,
main() { double x,n,sum=0; scanf("%lf",&n); if (((int)n%2)!=
while((scanf("%lf%lf%lf",&a,&b,&c))==3)怎么理解?
谁知道scanf("%c:%lf%*c",&c,&a);
C语言 %lf 和 scanf("%s%lf%d",card[i].name,&card[i].value,&card[
C语言 计算圆柱体积#includevoid mian(){ double r,h,v; scanf_s("%lf %l
while(scanf("%lf",&x)!=EOF)
scanf("%lf%lf%lf",&a,&b,&c)其中的l是什么意思 为什么我去掉L是编译成功 可1运行程序就退出来
LF是什么意思?