求教各位死循环的问题
程序代码:
#include<stdio.h> #include<math.h> void dislpaymenu() { printf("\t\t ****计算器菜单****\n"); printf("\t\t *****1.加法*****\n"); printf("\t\t *****2.减法*****\n"); printf("\t\t *****3.乘法*****\n"); printf("\t\t *****4.除法*****\n"); printf("\t\t *****5.退出*****\n"); } void main() { while(1) { int select; dislpaymenu(); scanf("%d",&select); switch(select) { int result,a,b; case 1: printf("进入加法程序\n"); printf("please intput two counts\n"); scanf("%d%d",&a,&b); printf("结果为%d\n",result=a+b); break; case 2: printf("进入减法程序\n"); printf("please intput two counts\n"); scanf("%d%d",&a,&b); printf("结果为%d\n",result=a-b); break; case 3: printf("进入乘法程序\n"); printf("please intput two counts\n"); scanf("%d%d",&a,&b); printf("结果为%d\n",result=a*b); break; case 4: printf("进入除法程序\n"); printf("please intput two counts\n"); scanf("%d%d",&a,&b); printf("结果为%d\n",result=a/b); break; case 5: exit(); break; } } }请问各位大侠 这个程序怎么才能不进入死循环啊 就是在进入加减法后 算完一道题一直可以算 而不退出啊 本人是菜鸟 谢谢了
新手 给分不是很多