#include int main(){
char f;
float d = 0;
float i = 0;float y = 0;//定义两个用于储存输入数值的函数
printf("输入计算表达式,各项之间使用空格分开:\n");
scanf("%f%c%f\n",&i,&f,&y);
if(f = '+'){
d = jia(i,y);
}
printf("%f\n",d);
}
float jia(float a;float b;){
float z;
z = a + b;
return (z);
}
编译软件提示
167C:\Users\xiong\Desktop\计算器.c[Error] conflicting types for 'jia'
117C:\Users\xiong\Desktop\计算器.c[Note] previous implicit declaration of 'jia' was here
C:\Users\xiong\Desktop\计算器.cIn function 'jia':
186C:\Users\xiong\Desktop\计算器.c[Error] 'a' undeclared (first use in this function)
186C:\Users\xiong\Desktop\计算器.c[Note] each undeclared identifier is reported only once for each function it appears in
1810C:\Users\xiong\Desktop\计算器.c[Error] 'b' undeclared (first use in this function)
float jian(float a;float b;){
}
float chen(float a;float b;){
}
float chu(float a;float b;){
}