KKRC系统1.0.0-test10

· · 个人记录

#include <bits/stdc++.h>
#include <windows.h>
#include<conio.h>
#define qdo 262
#define qre 294
#define qmi 330
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define Do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
#define itn int
using namespace std;

char inp1;
int inp2;

void cls();
void anzhuang();
void start(int t);
void kkrc01();
void startkkrc();
void color(short x);
void HideCursor();
void kkrc();

void cls(){
    system("cls");
    return ;
}

void anzhuang(){
    color(1);
    cout<<"您安装的是KKRC 1.0.0-test10 系统(2022/12/28 21:13)"<<endl;
    cout<<"请按任意键继续安装"<<endl;
    getch();
    srand(time(0));
    int anz=0;
    color(1);
    cls();
    while(anz<100){
        cout<<"正在下载系统......  %"<<anz;
        anz+=rand()%11+1;
        Sleep(rand()%2000);
        cls();
    }
    cout<<"正在下载系统......  %100";
    Sleep(3000);
    cls();
    anz=0;
    while(anz<100){
        cout<<"正在安装系统......  %"<<anz;
        anz+=rand()%21+1;
        Sleep(rand()%1000);
        cls();
    }
    cout<<"正在安装系统......  %100";
    Sleep(4000);
    cls();
    cout<<"安装成功!"<<endl;
    Sleep(2000);
    system("pause");
    cout<<"准备试运行......"<<endl;
    Sleep(5000);
    kkrc01();
    return ;
}

void start(int t){
    srand(time(0));
    if (t==1){
        cout<<"检测到您启动失败过,是否要检测系统?(y,n)"<<endl;
        inp1=getch();
        if (inp1=='y'){
            for (int i=0;i<=10;i++){
                cout<<"检测中......"<<endl;
                cout<<"============"<<endl;
                cout<<"|";
                for (int j=1;j<=i;j++){
                    cout<<"█";
                }
                for (int j=i;j<10;j++){
                    cout<<" ";
                }
                cout<<"|"<<endl<<"============";
                Sleep(rand()%2000);
                cls();
            }
        }
    }
    cls();
    startkkrc();
    cout<<"....."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<".... ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"....  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"... .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"...  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<".. .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"..  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<". .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<".  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<" .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"  .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"   .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"    .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"     .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"      .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"       .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"        .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"         .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"          .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"           .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"            .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"             .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"              .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"               .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                 .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                  .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                   .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                    .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                     .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                      .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                       .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                        .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                         .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                          .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                           .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                            .  .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                             .  .  .  .  "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                              .  .  .  . "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                               .  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                .  .  .  "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                 .  .  . "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                  .  .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                   .  .  "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                    .  . "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                     .  ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                      .  "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                       . "<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                        ."<<endl;
    Sleep(50);
    cls();
    startkkrc();
    cout<<"                                         "<<endl;
    Sleep(50);
    cls();
    for (int i=1;i<=5;i++){
        startkkrc();
        cout<<""<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<" ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<".  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<" .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<".  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<" .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<".  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<" .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<".  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<" .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"  .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"   .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"    .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"     .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"      .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"       .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"        .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"         .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"          .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"           .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"            .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"             .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"              .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"               .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                 .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                  .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                   .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                    .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                     .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                      .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                       .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                        .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                         .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                          .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                           .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                            .  .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                             .  .  .  .  "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                              .  .  .  . "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                               .  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                .  .  .  "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                 .  .  . "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                  .  .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                   .  .  "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                    .  . "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                     .  ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                      .  "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                       . "<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                        ."<<endl;
        Sleep(50);
        cls();
        startkkrc();
        cout<<"                                         "<<endl;
        Sleep(50);
        cls();
    }
    color(7);
    kkrc();
    return ;
}

void kkrc(){
    srand(time(0));
    color(10);
    cout<<"The system is powered on normally"<<endl;
    Sleep(2000);
    cls();
    color(7);
    cout<<"hello!"<<endl;
    Sleep(500);
    time_t t = time(nullptr);
    struct tm* now = localtime(&t);
    std::stringstream time;
    time << now->tm_year + 1900 << "年";
    time << now->tm_mon + 1 << "月";
    time << now->tm_mday << "日 ";
    time << now->tm_hour << ":";
    time << now->tm_min << ":";
    time << now->tm_sec;
    cout<<"现在是"<<time.str()<<endl;
    getchar();
    ncr:
    cls();
    cout<<"KKRC 1.0.0-test10"<<endl;
    cout<<"_______________________________________"<<endl;
    cout<<"1.时钟"<<endl;
    cout<<"2.浏览器"<<endl;
    cout<<"3.关于"<<endl;
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    cout<<"_______________________________________"<<endl;
    inp1=getch();
    if (inp1=='1'){
        cls();
        while(true){
            cout<<"现在是"<<time.str()<<endl;
            cout<<"1.退回 2.刷新"<<endl;
            inp1=getch();
            if (inp1=='1'){
                goto ncr;
            }
            cls();
        }
    }
    else if (inp1=='2'){
        while(true){
            cls();
            string jas;
            cout<<"网址:";
            getchar();
            getline(cin,jas);
            string frrfe="start "+jas;
            char frrrr[100005];
            for (int i=0;i<frrfe.size();i++){
                frrrr[i]=frrfe[i];
            }
            system(frrrr);
            cout<<"1.退回 2.继续"<<endl;
            inp1=getch();
            if (inp1=='1'){
                goto ncr;
            }
        }
    }
    else if (inp1=='3'){
        cls();
        cout<<"版本:1.0.0-test10测试版"<<endl;
        cout<<"指导:沙宸安"<<endl;
        cout<<"1.0.0-test20预计更新内容:内置多种程序"<<endl;
        cout<<"请按任意键退回"<<endl;
        getch();
        goto ncr;
    }
}

void kkrc01(){
    srand(time(0));
    cout<<"启动中......"<<endl;
    Sleep(rand()%5000);
    cout<<"启动成功!"<<endl;
    cout<<"准备运行测试程序......"<<endl;
    Sleep(8000);
    srand(time(0));
    int t=rand()%10+1;
    int r=0;
    if (t==2){
        cout<<"运行失败!"<<endl;
        cout<<"重新运行......"<<endl;
        r=1;
        Sleep(8000);
    }
    cout<<"运行成功!"<<endl;
    color(10);
    cout<<"系统以已安装完毕,可以正常运行"<<endl;
    color(7);
    cout<<"现在要启动吗?(y,n)"<<endl;
    inp1=getch();
    if (inp1=='y'){
        Sleep(1000);
        start(r);
    }
    else{
        cout<<"要启动的时候请按任意键哦(你小子敢按关机键试试)";
        getch();
        start(r);
    }
    return ;
}

void HideCursor(){
    CONSOLE_CURSOR_INFO cursor;
    cursor.bVisible = FALSE;
    cursor.dwSize = sizeof(cursor);
    HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleCursorInfo(handle, &cursor);
}

void color(short x) {
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x);
}

void startkkrc(){
    color(10);
    cout<<endl<<endl<<endl<<endl<<endl;
    cout<<" ++   ++   ++   ++   ++++++     ++++++   "<<endl;
    cout<<" ++  ++    ++  ++    ++    +   +         "<<endl;
    cout<<" ++ ++     ++ ++     ++    +   +         "<<endl;
    cout<<" ++++      ++++      ++++++    +         "<<endl;
    cout<<" ++ ++     ++ ++     ++++      +         "<<endl;
    cout<<" ++  ++    ++  ++    ++  ++    +         "<<endl;
    cout<<" ++   ++   ++   ++   ++   ++    ++++++   "<<endl;
    return ;
}

int main(){
    HideCursor();
    cout<<"hello!"<<endl;
    Sleep(2000);
    cout<<"检测到您未安装系统,请问要安装吗?(y,n)"<<endl;
    inp1=getch();
    if (inp1=='n'){
        return 0;
    }
    else if (inp1=='y'){
        cls();
        anzhuang();
    }
    return 0;
}

更新日志

1.0.0-test01~1.0.0-test01.01:初始版

1.0.0-test02~1.0.0-test02.01:优化代码,优化输入,优化输出

1.0.0-test10 加入了系统!