改正錯(cuò)誤
#include<stdio.h>
void main()
switch? (getcher())
{
int a,b,c;
case "+", c = a+b;
case "–", c = a–b;
case "*",? c = a*b;
case "/",? c = a/b;
default : printf("error\n");
}
誰(shuí)能幫我改改,感謝感謝
#include<stdio.h>
void main()
switch? (getcher())
{
int a,b,c;
case "+", c = a+b;
case "–", c = a–b;
case "*",? c = a*b;
case "/",? c = a/b;
default : printf("error\n");
}
誰(shuí)能幫我改改,感謝感謝
2016-10-19
舉報(bào)
2016-10-20
1.int a,b,c; 沒(méi)有賦初值,默認(rèn)值0,2.每個(gè)case語(yǔ)句需要break結(jié)束。
2016-10-20
減號(hào)用錯(cuò)了
2016-10-20
#include<stdio.h>
int main()
{
?switch (getchar())
?{
??int a,b,c;
?case '+': c = a+b;
?case '-': c = a-b;
?case '*': c = a*b;
?case '/': c = a/b;
?default : printf("error\n");
?}
}
2016-10-19
第七行的減號(hào)你用錯(cuò)了用這個(gè)-