• 个人简介

    我爱编程 #include<bits/stdc++.h> #include<windows.h> #include using namespace std; int main(){ string mingzi,a; cout<<" 请输入您的名字 "<<endl; cin>>mingzi; system("cls"); cout<<" 欢迎"<<mingzi<<"进入游戏!"<<endl; Sleep(5000); system("cls"); cout<<" [---------------]"<<endl; cout<<" [ | ]"<<endl; cout<<" [ | ]"<<endl; cout<<" [ [ ] ----- ]"<<endl; cout<<" [ [ ] | ]"<<endl; cout<<" [ | ]"<<endl; cout<<" [ | ]"<<endl; cout<<" [---------------]"<<endl; cout<<" 姚宇游戏 "<<endl; cout<<" 用心做好每一款游戏!"<<endl; Sleep(5000); system("cls"); cout<<" 健康游戏公告 "<<endl; cout<<" "<<endl; cout<<" 抵制不良游戏,拒绝盗版游戏。"<<endl; cout<<" 注意自我保护,谨防上当受骗。"<<endl; cout<<" 适当游戏益脑,沉迷游戏伤身。"<<endl; cout<<" 合理安排时间,享受健康生活。"<<endl; cout<<" (输入进入游戏)"<<endl; cin>>a; system("cls"); while(true){ int zhunkaohao=12345678,duicnt,cuocnt,fenshu=300; string kaoshengming,daan,b; cout<<"用户名:"<<mingzi<<endl; cout<<" c++考试模拟器 "<<endl; cout<<"请输入您的准考号进入考试"<<endl; cout<<"您的准考号是:"<<zhunkaohao<<endl; cin>>zhunkaohao; if(zhunkaohao==12345678){ MessageBox(NULL,"确定进入考试?","确定",MB_OK); system("cls"); cout<<" 请输入考生姓名 "<<endl; cin>>kaoshengming; system("cls"); cout<<" 1.选择题(共十道题) "<<endl; Sleep(5000); system("cls"); if(MessageBox(NULL,"#include是否是头文件?","第一题",MB_YESNO)==IDYES){ duicnt++; }else{ cuocnt++; fenshu=fenshu-10; } if(MessageBox(NULL,"if是否表示如果?","第二题",MB_YESNO)==IDYES){ duicnt++; }else{ cuocnt++; fenshu=fenshu-10; } if(MessageBox(NULL,"while(n!=0)是否是死循环?","第三题",MB_YESNO)==IDYES){ cuocnt++; fenshu=fenshu-10; }else{ duicnt++; } if(MessageBox(NULL,"char是否是字符串?","第四题",MB_YESNO)==IDYES){ cuocnt++; fenshu=fenshu-10; }else{ duicnt++; } if(MessageBox(NULL,"for循环是否是无限循环?","第五题",MB_YESNO)==IDYES){ cuocnt++; fenshu=fenshu-10; }else{ duicnt++;

    	}
    	if(MessageBox(NULL,"string是否是字符串?","第六题",MB_YESNO)==IDYES){
    		duicnt++;	
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	if(MessageBox(NULL,"&&是否是关系运算符?","第七题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"char是否是字符?","第八题",MB_YESNO)==IDYES){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	if(MessageBox(NULL,">是否是逻辑运算符?","第九题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"!是否是逻辑运算符?","第十题",MB_YESNO)==IDYES){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	cout<<"   2.判断题(共十题)   "<<endl;
    	Sleep(5000);
    	system("cls");
    if(MessageBox(NULL,"_不能作为变量名的开头。","第一题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}	
    		if(MessageBox(NULL,"&&,||,!=,是三个逻辑运算符。","第二题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"小叶说while(true){}是当型循环。","第三题",MB_YESNO)==IDYES){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}	
    		if(MessageBox(NULL,"cout的箭头是朝右的。","第四题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"数字可以作为变量名的开头。","第五题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}	
    		if(MessageBox(NULL,"=表示相等。","第六题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"if打完在下面打一个else是if双分支。","第七题",MB_YESNO)==IDYES){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}	
    		if(MessageBox(NULL,"cin的箭头是朝左的。","第八题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	if(MessageBox(NULL,"if打完在下面打一个else if是if多分支。","第九题",MB_YESNO)==IDYES){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}	
    		if(MessageBox(NULL,"int main()不需要返回值。","第十题",MB_YESNO)==IDYES){
    		cuocnt++;
    		fenshu=fenshu-10;
    	}else{
    		duicnt++;
    	}
    	cout<<"     3.填空题(共十题)"<<endl;
    	Sleep(5000);
    	system("cls");
    	cout<<"  代码的输入需要在()下书写。"<<endl;
    	cin>>daan;
    	if(daan=="英文"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  使用浮点需要用()和()。"<<endl;
    	cin>>daan;
    	if(daan=="float double"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  预处理命令是()。"<<endl;
    	cin>>daan;
    	if(daan=="#include<iostream>"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  当型循环是()。"<<endl;
    	cin>>daan;
    	if(daan=="while(true)"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  使用Sleep函数需要用#include()。"<<endl;
    	cin>>daan;
    	if(daan=="<windows.h>"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  能让全屏清除的代码是()。"<<endl;
    	cin>>daan;
    	if(daan=="system(\"cls"")"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  定义无返回值函数是的代码()。"<<endl;
    	cin>>daan;
    	if(daan=="void"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  c++中表示如果代码是()。"<<endl;
    	cin>>daan;
    	if(daan=="if"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	system("cls");
    	cout<<"  我们使用的c++名称是()。"<<endl;
    	cin>>daan;
    	if(daan=="Dev-C++"){
    		duicnt++;
    	}else{
    		cuocnt++;
    		fenshu=fenshu-10;
    	}
    	cout<<"   考试结束!   "<<endl;
    	cout<<" 考生"<<kaoshengming<<"的成绩是:"<<endl;
    	cout<<"总分数:"<<fenshu<<endl;
    	cout<<"答对的题目:"<<duicnt<<endl;
    	cout<<"答错的题目:"<<cuocnt<<endl;
    	cout<<"   输入返回"<<endl;
    	cin>>b;
    }else{
    	MessageBox(NULL,"输入错误!","错误",MB_OK);
    	system("cls");
    	
    }
    

    } return 0; } #include<bits/stdc++.h> using namespace std; int main(){ int mubiao=100; mubiao=mubiao/43/5; int number=190; cout<<"!------数字炸弹-------!"<<endl; cout<<"!-----play game-----!"<<endl; cout<<"-------是否进入-------!"<<endl; cout<<"!---------yes---------!"<<endl; cout<<"!********************!"<<endl; srand(time(NULL)); mubiao=rand()%101; while(number!=mubiao){ cout<<"请输入你要猜的数字(0~100):"<<endl; cin>>number; if(number>mubiao){ cout<<"猜大了\n"; } if(number<mubiao){ cout<<"猜小了\n"; } if(number==mubiao){ cout<<"猜对了\n"; } } return 0; }

  • 最近活动