Q:
#include<stdio.h>
int main()
{
char A,B,C,D,s;
float
z;
float x,y;
printf("if you want add input A\nsubtraction input B\nThe
multiplication input C\ndivision input
D\n");
scanf("%c",&s);
scanf("%f%f",&x,&y);
if
(s==A)
{
he(x,y);
}
if (s==B)
{
cha(x,y);
}
if
(s==C)
{
ji(x,y);
}
if (s==D)
{
shang(x,y);
}
return(0);
}
void he(float x,float y
{
float z;
z=x+y;
printf("liang ge shu de he is %f",z );
}
void
cha(float x,float y)
{
float z;
z=x-y;
printf("liang ge shu de cha is %f",z
);
}
void ji(float x,float y)
{
float z;
z=x*y;
printf("liang ge shu de ji is %f",z );
}
void shang(float x,float y)
{
float z;
z=x/y;
printf("liang ge shu de shang is %f",z
);
}
老师,这个哪里错了?
A:
A,B,。。要写成‘A‘
main()中你对函数没有声明
原文地址:http://www.cnblogs.com/lpjia/p/3779385.html