小程序(2.0)
  • 板块灌水区
  • 楼主Gary0111
  • 当前回复9
  • 已保存回复9
  • 发布时间2024/9/28 16:22
  • 上次更新2024/9/28 18:37:14
查看原帖
小程序(2.0)
1430626
Gary0111楼主2024/9/28 16:22
#include<bits/stdc++.h>
using namespace std;
char i [1000];
char b [1000];
int a;
int cmd(){
	cout << "Microsoft Windows [版本 10.0.19045.4780]\n";
	cout <<"(c) Microsoft Corporation。保留所有权利。\n";
	cout <<"\n";
	return 0;	
}
int no(char c [1000]){
	cout <<"'"<<c<<"' 不是内部或外部命令,也不是可运行的程序\n";
	cout <<"或批处理文件。\n";
	return 0;
}
int run(int d,int e){
	srand(time(NULL));
	for(int i=0;i<=d;i++){
	a= rand() % e;
	cout <<(char)a;
	}
	cout <<"`\n";
	return 0;
}
int main(){
	cmd();
	cout <<"C:\\Users\\gary>";
	for(;;){
		cin >>i;
		if(strcmp(i,"run")==0){
			cout <<"\n";
			cout <<"C:\\Users\\gary>what?\n";
			cout <<"C:\\Users\\gary>";
			cin >>b;
			if(strcmp(b,"/1/")==0){
    			run(100,100);
			}else if(strcmp(b,"win32")==0){
				run(200,200);
			}else{
				no(b);
			}

		}else if(strcmp(i,"leave")==0){
			cout <<"C:\\Users\\gary>leave?\n";
			cout <<"C:\\Users\\gary>";
			char x [10];
			cin >>x;
			if(strcmp(x,"yes")==0){
				cout <<"C:\\Users\\gary>OK";
				_sleep[2000];
				break;
			}
		}else if(strcmp(i,"cmd")==0){
			cmd();
		}else{
			no(i);
		}
		cout <<"C:\\Users\\gary>";
	}
	return 0;
}
2024/9/28 16:22
加载中...