出什么问题了?
程序代码:
#include<iostream> #include<string> #include<fstream> #include<windows.h> using namespace std; void cifang() { cout << "新功能正在开发中"; } void jisuanqi(void) { cout << "正在加载中" << endl; double diyigeshu; string fuhao; double diergeshu; cout << "加载成功\n请输入你要算的算式,输入格式:第一个数“空格”符号“空格”第二个数\n如:1 + 1, 1 * 1, 1 - 1, 1 / 1, 1 mod 1, 1 ^ 1,"; cin >> diyigeshu >> fuhao >> diergeshu; if (fuhao == "+") { cout << "答案是" << diyigeshu + diergeshu; } else { if (fuhao == "-") { cout << "答案是" << diyigeshu - diergeshu; } else { if (fuhao == "*") { cout << "答案是" << diyigeshu * diergeshu; } else { if (fuhao == "/") { cout << "答案是" << diyigeshu / diergeshu; } else { if (fuhao == "mod") { int t, pop; t = diyigeshu; pop = diergeshu; cout << "答案是" << t % pop; } else { if (fuhao == "^") { //“这个函数要修改”cifang(diyigeshu,diergeshu); } else { cout << "输入错误,十秒后会再来一次"; Sleep(10000); jisuanqi; } } } } } } } void da() { cout << "正在加载中\n"; double max=-9999999999; short geshu=0; double a{ 0 }; short dijig=554; cout << "加载成功\n请输入你想输入的数,零表示结束。"; do { geshu++; cout << "请输入第" << geshu << "个数"; cin >> a; if (a != 0 && a >= max) { max = a; dijig = geshu; } } while (a!=0); { } cout << "最"; Sleep(500); cout << "大"; Sleep(500); cout << "的"; Sleep(500); cout << "数"; Sleep(500); cout << "是"; Sleep(500); cout << max; cout << "是"; Sleep(500); cout << "第"; Sleep(500); cout << dijig; Sleep(500); cout << "个"; while (true) { } } void xiao() { cout << "正在加载中\n"; double max = 9999999999; short geshu = 0; double a{ 0 }; short dijig = 554; cout << "加载成功\n请输入你想输入的数,零表示结束。"; do { geshu++; cout << "请输入第" << geshu << "个数"; cin >> a; if (a != 0 && a <= max) { max = a; dijig = geshu; } } while (a != 0); { } cout << "最"; Sleep(500); cout << "小"; Sleep(500); cout << "的"; Sleep(500); cout << "数"; Sleep(500); cout << "是"; Sleep(500); cout << max; cout << "是"; Sleep(500); cout << "第"; Sleep(500); cout << dijig; Sleep(500); cout << "个"; while (true) { } } int main() { cout << "正在加载中,请稍后。稍安勿躁,就一杯茶的功夫\n" << endl; string da_xiao; const double i = 1.2; cout << "加载成功\n求最大/小数/计算器,作者:万致远 版本"; printf("%f""\n", i); cout << "求大?求小?"; cin >> da_xiao; if (da_xiao == "大") { da(); } else { if (da_xiao == "小") { xiao(); } else { if (da_xiao=="计算器") { jisuanqi; } else { cout << "新功能正在开发中,或请更新版本"; } } } }运行可以,但输入计算器就有问题,jisuanqi根本没被执行