我的计算器(2.5版本)

Even226 逗比 2023-09-05 21:40:25 3
#include <iostream>
#include <stack>
#include<windows.h>
#include <math.h>
using namespace std;
double inStack();
void calculate(stack<char>& Ope, stack<double>& Num);
void factorial(stack<double>& Num);
int priority(char ope_);
int main() {
	cout<<"     E";
	Sleep(900);
	cout<<"v";
	Sleep(900);
	cout<<"e";
	Sleep(900);
	cout<<"n";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<"6";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<".";
	Sleep(900);
	cout<<"5 ";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<""<<endl; 
	Sleep(100);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(100);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(50);
	cout<<">";
	Sleep(1500);
	cout<<"%99";
	Sleep(1500);
	cout<<"%99.5";
	Sleep(1500);
	cout<<"%99.9";
	Sleep(3000);
	cout<<"%100"<<endl;
	Sleep(2000);
	cout<<"              开始     "<<endl;
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_"<<endl;
	Sleep(500);
	cout<<"                    "<<endl; 
    char op;
    double num1, num2;
	Sleep(100);
    cout << "请输入运算符 (+, -, *, /): ";
    cin >> op;
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<""<<endl;
	Sleep(500);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<"."<<endl;
	Sleep(150);
    cout << "请输入两个操作数(中间打空格): ";
    cin >> num1 >> num2;
	Sleep(50);
	cout<<"";
	Sleep(50);
	cout<<"";
	Sleep(50);
	cout<<""<<endl;
	Sleep(500);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<"."<<endl;
    switch(op) {
        case '+':
            cout << num1 << " + " << num2 << " = " << num1 + num2;
            break;
        case '-':
            cout << num1 << " - " << num2 << " = " << num1 - num2;
            break;
        case '*':
            cout << num1 << " * " << num2 << " = " << num1 * num2;
            break;
        case '/':
            if (num2 != 0)
                cout << num1 << " / " << num2 << " = " << num1 / num2;
            else
                cout << "除数不能为零!!!";
            break;
        default:
            cout << "无效的运算符!!!";
            break;
    }

    return 0;
}
{{ vote && vote.total.up }}

共 3 条回复

lyhldy MineC++raft

Sleep有亿点点多

Even226 逗比

我的2.5.8.6测试版本,中间有很多没发

Even226 逗比
#include <iostream>
#include <stack>
#include<windows.h>
#include <math.h>
using namespace std;
double inStack();
void calculate(stack<char>& Ope, stack<double>& Num);
void factorial(stack<double>& Num);
int priority(char ope_);
int main() {
	cout<<"     E";
	Sleep(900);
	cout<<"v";
	Sleep(900);
	cout<<"e";
	Sleep(900);
	cout<<"n";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<"6";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"2";
	Sleep(900);
	cout<<".";
	Sleep(900);
	cout<<"5";
	Sleep(900);
	cout<<".";
	Sleep(900);
	cout<<"8";
	Sleep(900);
	cout<<".";
	Sleep(900);
	cout<<"6  ";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<""<<endl; 
	Sleep(500);
	cout<<"%5 ";
	Sleep(500);
	cout<<"%10 ";
	Sleep(500);
	cout<<"%20 ";
	Sleep(500);
	cout<<"%30 ";
	Sleep(500);
	cout<<"%40 ";
	Sleep(500);
	cout<<"%50 ";
	Sleep(500);
	cout<<"%60 ";
	Sleep(500);
	cout<<"%70 ";
	Sleep(500);
	cout<<"%80 ";
	Sleep(700);
	cout<<"%90 ";
	Sleep(700);
	cout<<"%100"<<endl;
	Sleep(2000);
	cout<<"              开始     "<<endl;
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_";
	Sleep(40);
	cout<<"_"<<endl;
	Sleep(500);
	cout<<"                    "<<endl; 
    char op;
    double num1, num2;
	Sleep(100);
    cout << "请输入运算符 (+, -, *, /): ";
    cin >> op;
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<"";
	Sleep(900);
	cout<<""<<endl;
	Sleep(500);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<".";
	Sleep(50);
	cout<<"."<<endl;
	Sleep(150);
    cout << "请输入两个操作数(中间打空格): ";
    cin >> num1 >> num2;
	Sleep(50);
	cout<<"";
	Sleep(50);
	cout<<"";
	Sleep(50);
	cout<<""<<endl;
	Sleep(500);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<".";
	Sleep(70);
	cout<<"."<<endl;
	Sleep(400);
	cout<<"   答案"; 
    switch(op) {
        case '+':
            cout << num1 << " + " << num2 << " = " << num1 + num2;
            break;
        case '-':
            cout << num1 << " - " << num2 << " = " << num1 - num2;
            break;
        case '*':
            cout << num1 << " * " << num2 << " = " << num1 * num2;
            break;
        case '/':
            if (num2 != 0)
                cout << num1 << " / " << num2 << " = " << num1 / num2;
            else
                cout << "除数不能为零!!!";
            break;
        default:
            cout << "无效的运算符!!!";
            break;
    }
    return 0;
}