想体验最新devc++2.0计算器吗?来下面看吧!!!(无bug)
上代码!
#include<bits/stdc++.h>
#include<windows.h>
#include<dir.h>
#define MAX 100
using namespace std;
int main(){
int a, b , c, d, e, f, g, j;
double h, i, k, l;
cout << "-----------------------------------------------------" << endl;
Sleep(1000);
cout << "--- 计算器2.0版本欢迎您! ----" << endl;
Sleep(1000);
cout << "- ** -" << endl;
Sleep(1000);
cout << "- **** -" << endl;
Sleep(1000);
cout << "- ****** -" << endl;
Sleep(1000);
cout << "-----------------------------------------------------" << endl;
Sleep(1000);
cout << "*****************************************************" << endl;
Sleep(1000);
cout << "1, 乘法 2,加法 3, 减法 4,除法 5,平方 6, 求比值";
cin >> a;
if(a == 1){
cout << "乘法世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> b >> c;
Sleep(2000);
cout << "结果为" << b*c << endl;
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else if(a == 2){
cout << "加法世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> d >> e;
Sleep(2000);
cout << "结果为" << d+e << endl;
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else if(a == 3){
cout << "减法世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> f >> g;
Sleep(2000);
cout << "结果为" << f-g << endl;
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else if(a == 4){
cout << "除法世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> h >> i;
Sleep(2000);
cout << "结果为" << endl;
printf("%.100lf",h/i);
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else if(a == 5){
cout << "平方世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> j;
Sleep(2000);
cout << "结果为" << j*j << endl;
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else if(a == 6){
cout << "求比值世界欢迎您!";
Sleep(1000);
cout << "请输入:" << endl;
cin >> k;
cout << ":";
cin >> l;
Sleep(2000);
cout << "结果为";
printf("%.100lf",k/l);
cout << endl;
Sleep(10000);
cout << "谢谢使用!";
Sleep(2000);
}else{
cout << "输入错误!";
}
return 0;
}