HUAWEI(Dev-C++手机版1.1)新加计算,计算崩溃

#include <iostream>
#include <string>
#include <conio.h> // 注意:这仅在Windows中有效
#include <windows.h>
#include <cstdlib>
#include <ctime>
#include <iomanip> // 用于格式化时间输出

using namespace std;
typedef long long ll;
int main() {
    // ...(之前的代码保持不变)
	int i;
	int number=00000000000;
	string name,placn;
	/*cout<<"正在加载资源——————"<<endl;
	for(i=0;i<10;i++){
	
		Sleep(3000);
		cout<<"█"; 
	}
	Sleep(2000);
	system("cls");
	cout<<"成功"<<endl;
	Sleep(1000);
	system("cls");//*/
	cout<<"\n\n\n\n\n\n\n\n\n\n\n                        				HUAWEI"<<endl;
	Sleep(3000);
	system("cls");
    while (true) {
    	cout << "_______________"<<endl;
        cout << "[1:资料       ]" << endl;
        cout << "|2:昵称       |" << endl;
        cout << "|3:地址       |" << endl;
        cout << "|4:电话号码   |" << endl;
        cout<<  "|5:计算器     |"<<endl;
        cout << "|q.退出       |"<< endl;
        cout <<"[_____________]"<<endl;
		while (!_kbhit()) {
        }

    
        char input = _getch();

       
        switch (input) {
            case '1':
            	system("cls");
                cout <<"资料"<<endl;
                cout<<"用户名:"<<name<<endl;
                cout <<"号码:"<<number<<endl; 
				cout<<"地址:"<<placn<<endl;
                cout<<"按Z退出"<<endl;
                while (!_kbhit()) {
                	
				}
                switch(input){
                	case 'z':cout<<""; 
				}
                break;
            case 'q':
                cout <<"退出程序..." << endl;
                return 0;
            case '2':
            	system("cls");
				cout<<"输入新名称"<<endl;
				getline(cin, name);
				cout<<"修改成功"<<endl;
				Sleep(1000);
				break; 
			case '3': 
				system("cls");
				cout<<"地址输入"<<endl;
				getline(cin,placn);
				cout<<"完成"<<endl;
				Sleep(1000); 
				break;
			case '4':
				system("cls");
				cout<<"填入号码"<<endl; 
				cin>>number;
				break;	
			case '5':
				system("cls");
				cout<<"			欢迎"<<endl;
				Sleep(2000);
				cout<<"1.输入数字a.运算符c.数字b"<<endl;
				cout<<"a的b次方输入数字a输入s数字b"<<endl;
				int a=0,b=0,g;
				char c;
				cin>>a;cin>>c;cin>>b;
				if(c=='+'){
					cout<<a<<c<<b<<"="<<a+b<<endl; 
				}
				if(c=='-'){
					cout<<a<<c<<b<<"="<<a-b<<endl;
				}
				if(c=='*'){
					cout<<a<<c<<b<<"="<<a*b<<endl; 
				}
				if(c=='/'){
					if(b==0){
						cout<<"错误"<<endl;
					}else{
						cout<<a<<c<<b<<"="<<a/b<<endl; 
					} 
				}
				if(c=='s'){
					g=a;
					for(int i=1;i<b;i++)
						g=g*a;
					cout<<a<<"的"<<b<<"次方等于"<<g<<endl; 
				}else{
					system("cls");
					for(int i=0;i<30;i++){
						for(int y=0;y<10;y++){
							cout<<"!#**%$@#^&&^%$@#$%^&**&^%$##%##@%^^%&#%#^$^&%^%&&#%$@#^$&";
						}
						//cout<<endl;
					}
					//return 0;
				} 
				Sleep(2000);
			
        }	

        system("cls");
    }
    return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值