解题日常C++

#include <iostream>
#include<windows.h>
#include<conio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include<windows.h>
#include<conio.h>
#include<cstdlib>
#include<ctime>
#include<fstream>
using namespace std;
string a[40];
long long s=1,shengming=20,bushu=0,leiren,lx1,ly1,lx,ly,fhq=1;
const long long n=59,jg=25,dengji=0;
bool yaoshi=0,leiren2;
string p=" M!|=.123456789%&_~?Win";
long long r=1;
char f='y';
void color(int a)//打印颜色
{
/*亮白*/    if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
/*蓝色*/    if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
/*绿色*/    if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
/*紫色*/    if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
/*红色*/    if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
/*黄色*/    if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
/*深蓝色*/    if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
/*土黄色or金黄色*/    if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
/*灰色接近白*/    if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
/*void lrmove(int yyy) {
    if (lx>x&&lx-1!='#'&&lx-1!='^'&&lx-1!='V'&&lx-1!='<'&&lx-1!='>'&&lx-1!='*'&&lx-1!='0'&&lx-1!='+'&&lx-1!='-'&&lx-1!='Z'&&lx-1!='D') {
        lx-=1;
    }
    if (lx<x&&lx+1!='#'&&lx+1!='^'&&lx+1!='V'&&lx+1!='<'&&lx+1!='>'&&lx+1!='*'&&lx+1!='0'&&lx+1!='+'&&lx+1!='-'&&lx+1!='Z'&&lx+1!='D') {
        lx+=1;
    }
    if (ly<y&&ly+1!='#'&&ly+1!='^'&&ly+1!='V'&&ly+1!='<'&&ly+1!='>'&&ly+1!='*'&&ly+1!='0'&&ly+1!='+'&&ly+1!='-'&&ly+1!='Z'&&ly+1!='D') {
        lx+=1;
    }
    if (ly<y&&ly-1!='#'&&ly-1!='^'&&ly-1!='V'&&ly+1!='<'&&ly-1!='>'&&ly-1!='*'&&ly-1!='0'&&ly-1!='+'&&ly-1!='-'&&ly-1!='Z'&&ly-1!='D') {
        if()
        lx-=1;
    }
}*/
long long numberaio(string n){
    for (int i = 0; i < 100000; i++) {
        if(n[i]=='\0')
        {
            return i;
        }
    }
}
void gotoxy(int y,int x) 
{
    COORD  coord;     
    coord.X=x;         
    coord.Y=y;
    HANDLE a=GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleCursorPosition(a,coord);    
}
void coutAIO(string b,int truefalse0 = 1,bool truefalse1 = 0){
    int i=0,s=0;
    long long a=numberaio(b);
    while(a!=0){
        s=rand()%9;
        if(a!=0&&s==0)
        {
            color(0);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==1)
        {
            color(1);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==2)
        {
            color(2);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==3)
        {
            color(3);
            cout << b[i];
            a--;
            i++;
            if(truefalse0!=false){
                Sleep(20);
            }
        }
        if(a!=0&&s==4)
        {
            color(4);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==5)
        {
            color(5);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==6)
        {
            color(6);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==7)
        {
            color(7);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==8)
        {
            color(8);
            cout << b[i];
            a--;
            i++;
        }
        if(truefalse0 ==1){
            Sleep(10);
        }
        if(truefalse0 ==2){
            Sleep(20);
        }
        if(truefalse0 ==3){
            Sleep(40);
        }
        if(truefalse0 ==4){
            Sleep(100);
        }
        if(truefalse0 ==5){
            Sleep(300);
        }
        if(truefalse0 ==6){
            Sleep(1000);
        }
    }
    if(truefalse1!=false){
        getch();
        system("cls");
    }
    cout << endl;
}
void ksjm()
{
	system("color f0");
	cout<<"按任意键开始游戏";
	getch();
	system("cls"); 
	for(long long i=1;i<=3;i++)
	{
		system("color 07");
		system("color 10");
		system("color 20");
		system("color 30");
		system("color 40");
		system("color 50");
		system("color 60");
		system("color 70");
		system("color 80");
		system("color 90");
		system("color a0");
		system("color b0");
		system("color c0");
		system("color d0");
		system("color e0");
		system("color f0");
	}
	cout<<"\n\n\n\n\n\n\n\n\n\n\n                                                      ";
	coutAIO("走迷宫",2);
	cout<<"\n";
	cout<<"                                                   ";
	coutAIO("出品:饼干,修改:努力的AIO",5);
	Sleep(1500);
} 
int start()
{
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一天,你坐着飞机,正打算去美国...         ",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一边看着电影,一边喝着饮料                  ",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("突然,飞机开始颠簸,你手中饮料摔到了地上,洒了一地         ",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("一秒钟后,飞机开始往下坠落",3);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("行李架上的行李掉了下来,砸中了你,你眼前一黑,昏了过去...         ",3);
	Sleep(1000);
	system("cls");
	Sleep(3000);
	coutAIO("醒来后,你发现你在一个无人区,误入了迷宫。                        ");
	getch();
	return 0;
}
void start(int n)
{
	system("cls");
    cout<<"加载中请稍等";
    Sleep(1000);
    gotoxy(0,0);
	for (int i=1;i<=n; i++)
	{
		cout<<"加载中.              "<<endl;
		cout<<"▏";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▎";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▍";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▋";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▊";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▏";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▎";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▍";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▌";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▋";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▊";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▉";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▉▏";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▉▎";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▉▍";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▉▌";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▉▋";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▉▊";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▉▉▏";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▉▉▎";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▉▉▍";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▉▉▌";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...              "<<endl;
		cout<<"▉▉▉▋";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中.              "<<endl;
		cout<<"▉▉▉▋";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中..              "<<endl;
		cout<<"▉▉▉▊";
		Sleep(20);
		gotoxy(0,0);
		cout<<"加载中...                  "<<endl;
		cout<<"▉▉▉▉";
		Sleep(20);
		gotoxy(0,0);
		system("cls");
	}
	coutAIO("加载完成!请等待十秒",4);
    Sleep(2000);
    system("cls");
    Sleep(8000);
    ksjm();
    start();
}
void welcome()
{
	color(6);
	gotoxy(20,40);
	coutAIO(" 走  迷  宫 ",3);
	gotoxy(21,40);
	coutAIO(" zou mi gong",3);
	Sleep(2000);
	gotoxy(23,40);
	coutAIO("H E P P Y",3);
	Sleep(200);
	gotoxy(24,40);
	coutAIO("    i m X 2 G",3);
	Sleep(1000);
	color(3);
	gotoxy(25,45);
	cout<<"imX2G出品,必是精品!\n";
	Sleep(2000);
	color(2);
	system("cls");
	start(10);
	gotoxy(0,60);
	system("cls");
	cout<<"\t\t\t\t\t\tv.5.6.4"; 
	gotoxy(0,0);
	printf("    WELCOME            \n");
	printf("╭──────────────────────────────────╮\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│                                  │\n");
	printf("│卍                              卐│\n");
	printf("╰──────────────────────────────────╯\n");
	gotoxy(2,2);
	coutAIO("欢迎来到《走迷宫》");
	gotoxy(3,2);
	coutAIO("作者:imX2G\n");
	gotoxy(4,2);
	coutAIO("祝你游戏愉快\n");
	gotoxy(5,2);
	coutAIO("(*^_^*)\n");
	system("pause");
}
void ww2()
{
	color(6);
	gotoxy(0,0);
	printf("    WELCOME            \n");
	printf("┌──────────────────────────────────────────────────────────────────────┐\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│                                                                      │\n");
	printf("│卍                                                                  卐│\n");
	printf("│卍卍                                                              卐卐│\n");
	printf("└──────────────────────────────────────────────────────────────────────┘\n");
	gotoxy(2,2);
	coutAIO("一个物体从高空落下,经过6秒落地。已知第一秒下落的距离是4.9m,以后\n",2);
	gotoxy(3,2);
	coutAIO("每一秒下落的距离都比前一秒多9.8m。这个物体下落前距离地面多少米?\n",2);
	gotoxy(4,2);
	coutAIO("答:  4.9*6+9.8*(1+2+3+4+5) = 4.9*6+4.9*2*15\n",2);
	gotoxy(5,2);
	coutAIO("=4.9*(6+30)  =4.9*36  =173.4        \n",2);
	gotoxy(6,2);
	coutAIO("                               4.9      \n",2);
	gotoxy(7,2);
	coutAIO("                              36       \n",2);
	gotoxy(8,2);
	coutAIO("                           *           \n",2);
	gotoxy(9,2);
	coutAIO("                          ───────────  \n",2);
	gotoxy(10,2);
	coutAIO("                             294       \n",2);
	gotoxy(11,2);
	coutAIO("                            144        \n",2);
	gotoxy(12,2);
	coutAIO("                          ───────────  \n",2);
	gotoxy(13,2);
	coutAIO("                            173.4      \n",2);
	getch();
}
void full_screen()
{   
    HWND hwnd = GetForegroundWindow();
    int cx = GetSystemMetrics(SM_CXSCREEN);            /* 屏幕宽度 像素 */
    int cy = GetSystemMetrics(SM_CYSCREEN);            /* 屏幕高度 像素 */

    LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE);   /* 获取窗口信息 */
    /* 设置窗口信息 最大化 取消标题栏及边框 */
    SetWindowLong(hwnd,GWL_STYLE,( l_WinStyle |WS_MAXIMIZE| WS_POPUP) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER);//  
    SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0);
}
void hys()//背景
{
	system("cls");
	cout<<"\n\n\n\n\n\n\n\n\n按1【日间色】\n";
	cout<<"按2【夜间色】\n";
	cout<<"按3【黑客】\n";
	cout<<"按4【科幻】\n";
	cout<<"按5【紫水晶】\n";
	char s;
	s=getch();
	while(s!='1'&&s!='2'&&s!='3'&&s!='4'&&s!='5')s=getch();
	switch(s-'0')
	{
		case 1:
			system("color f0");
			break;
		case 2:
			system("color 0f");
			break;
		case 3:
			system("color 0a");
			break;
		case 4:
			system("color 09");
			break;
		case 5:
			system("color 01");
			break;
	}
	system("cls");
	return ;
}
int main()
{
    ww2();
    gotoxy(25,2);
    return 0;
}

OK了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值