请教一下关于计算器的编写
程序代码:
#include<stdio.h> int main(void) { float number1,number2,S=0; char opor, E; printf("Begin Calculation.\n"); scanf("%f %c",&S,&opor); do{ switch (opor) { case '+': printf("=%f %c",S, opor); break; case '-': printf("=%f %c",S, opor); break; case '*': printf("=%f %c",S, opor); break; case '/': if (S == 0) printf("Division by zero.\n"); else printf("=%f %c",S, opor); break; default: printf("Unknow operator"); break;} }while(opor == E); return 0; }
转不动啊。。本人新手一枚,请各位帮忙看看哪里逻辑出问题了。