繼承人的代碼:Im做一個計算器c和錯誤彈出,當我嘗試運行它
#include <stdio.h>
#include <stdlib.h>
void main() {
int op,a,b;
printf("***Welcome to the calculatron***\n\n");
do{
printf("choose an operation\n\n");
print(" 1 : Addition\n 2: Substraction\n 3: Multiplication\n 4: Division");
scanf("%d",&op)
}while((op != 1 && (op != 2) && (op != 3) && (op != 4));
printf("Type the first number");
scanf("%d",&op)
printf("Type the second number");
scanf("%d",&op);
switch(op)
case 1:
printf("You have chosen the Addition\n");
printf("%d + %d = %d",a,b,a+b);
break;
case 2:
printf("You have chosen the Substraction\n");
printf("%d + %d = %d",a,b,a-b);
break;
case 3:
printf("You have chosen the Multiplication\n");
printf("%d + %d = %d",a,b,a*b);
break;
case 4:
printf("You have chosen the Division\n");
printf("%d + %d = %d",a,b,a/b);
break;
}
的錯誤
expected " ; " before " } " token and expected ") " before " ; " token are in lines 13 and 41
我不知道該怎麼辦,請幫忙。
包括如下內容:#include #include –
'void main()'是一個無效的簽名,調用UB。 – Olaf
兩個'scanf'調用寫入時沒有終止';'... –