问题标题: LOS 3.0正式发布!

0
0
已解决
李承耀
李承耀
新手光能
新手光能
#include<bits/stdc++.h>
#include<windows.h>
#define clear_cin() fflush(stdin)
#define KAIJI 1
#define INA 2
#define NTUSER 1
using namespace std;
int kjhm,usernum;
char *p;
string color;
char user[10005][2][105]={{"",""},{"admin",""}}; 
int desktop(int);
void clear();
string getver(bool =true);
void shutdown(int =1); 
void startup(int =0);
void s_d(int);
void notebook();
void setname();
void csh();
void ramtst(bool =false);
char _p(int);
int q(char);
int f(string,int);
string g(int,int);
void jzzh();
void gtuser();
void login();
void gjff();
void read_Type();
void last_normal_shutdown();
void ert();
void pro();
void puanduan();
void otpt();
bool qspd();
int pd2();
int main(){
    ramtst();
    setname();
    puanduan();
    read_Type();
    csh();
    startup();
    clear();
    while(1){
        clear();
        int type=desktop(INA);
        if(type==0){
            shutdown();
            clear();
            return 0;
        }
        else if(type==1){
            csh();
            clear();
            startup(2);
            clear();
            startup();
            type=desktop(KAIJI);
        }
        clear();
    }
    return 0;
}
int desktop(int cs){
    gtuser();
    login();
    i9:
    clear(); 
    cout<<"1.应用\n2.电源\n3.设置\n";
    string s;
    getline(cin,s);
    clear();
    if(s=="1"||s=="应用"||s=="1.应用"){
        i4:
        cout<<"1.版本号\n2.小小记事本\n3.数学工具\n4.检测环境\n5.返回\n";
        string s;
        getline(cin,s);
        clear();
        if(s=="1"||s=="版本号"||s=="1.版本号"){
            getver();
            clear(); 
        }
        else if(s=="2"||s=="小小记事本"||s=="2.小小记事本"){
            notebook();
            setname();
        }
        else if(s=="3"||s=="数学工具"||s=="3.数学工具"){
            inb:
            cout<<"1.开根号\n2.加法\n3.减法\n4.乘法\n5.除法\n6.按位与\n7.按位或\n8.按位异或\n9.按位取反\n10.逻辑与\n11.逻辑或\n12.逻辑非\n13.逻辑相等\n14.进制转换\n15.返回\n";
            getline(cin,s);
            clear();
            if(s=="1"||s=="sqrt"||s=="1.开根号"||s=="1.sqrt"||s=="开根号"){
                cout<<"请输入您要开根号的值";
                double n;
                cin>>n;
                clear();
                if(n>=0)
                cout<<n<<"开根号之后是"<<sqrt(n)<<endl;
                else cout<<"负数没有平方根\n";
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="2"||s=="加法"||s=="2.加法"){
                cout<<"请输入两个数";
                double a,b;
                cin>>a>>b;
                cout<<a<<"+"<<b<<"="<<a+b<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="3"||s=="减法"||s=="3.减法"){
                cout<<"请输入两个数";
                double a,b;
                cin>>a>>b;
                cout<<a<<"-"<<b<<"="<<a-b<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="4"||s=="乘法"||s=="4.乘法"){
                cout<<"请输入两个数";
                double a,b;
                cin>>a>>b;
                cout<<a<<"*"<<b<<"="<<a*b<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="5"||s=="除法"||s=="4.除法"){
                ina: 
                cout<<"请输入两个数";
                double a,b;
                cin>>a>>b;
                if(b==0){
                    ert();
                    goto ina; 
                }
                else{
                    cout<<a<<"/"<<b<<"="<<a/b<<endl;
                    cout<<"按Enter继续";
                }
                getchar();
                getchar();
            }
            else if(s=="6"||s=="按位与"||s=="6.按位与"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"&"<<b<<"="<<(a&b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="7"||s=="按位或"||s=="7.按位或"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"|"<<b<<"="<<(a|b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="8"||s=="8.按位异或"||s=="8.按位异或"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"^"<<b<<"="<<(a^b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="9"||s=="9.按位取反"||s=="按位取反"){
                long long a;
                cout<<"请输入一个数";
                cin>>a;
                cout<<"~"<<a<<"="<<(~a)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="10"||s=="10.逻辑与"||s=="逻辑与"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"&&"<<b<<"="<<(a&&b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="11"||s=="11.逻辑或"||s=="逻辑或"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"||"<<b<<"="<<(a||b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="12"||s=="12.逻辑非"||s=="逻辑非"){
                long long a;
                cout<<"请输入一个数";
                cin>>a;
                cout<<"!"<<a<<"="<<(!a)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="13"||s=="13.逻辑相等"||s=="逻辑相等"){
                long long a,b;
                cout<<"请输入两个数";
                cin>>a>>b;
                cout<<a<<"=="<<b<<"="<<(a==b)<<endl;
                cout<<"按Enter继续";
                getchar();
                getchar();
            }
            else if(s=="14"||s=="14.进制转换"||s=="进制转换")jzzh();
            else if(s=="15"||s=="返回"||s=="15.返回")goto i4;
            else{
                ert();
                goto inb;
            }
        }
        else if(s=="4"||s=="检测环境"||s=="4.检测环境"){
            i5:
            cout<<"1.内存测试\n2.返回\n";
            getline(cin,s);
            clear();
            if(s=="1"||s=="内存测试"||s=="1.内存测试"){
                ramtst(true);
            } 
            else if(s=="2"||s=="返回"||s=="2.返回"){
                goto i4;
            }
            else{
                ert();
                goto i5;
            }
        }
        else if(s=="5"||s=="返回"||s=="5.返回"){
            goto i9; 
        }
        else{
            ert();
            goto i4;
        }
    }
    else if(s=="2"||s=="电源"||s=="2.电源"){
        ir:
        system("cls");
        cout<<"1.关闭LOS\n2.重新启动LOS\n3.返回\n";
        getline(cin,s);
        if(s=="1"||s=="关闭"||s=="关闭LOS"||s=="1.关闭LOS"){
            return 0;
        }
        else if(s=="2"||s=="重启"||s=="重新启动"||s=="重新启动LOS"||s=="2.重新启动LOS"){
            return 1;
        }
        else if(s=="3"||s=="返回"||s=="3.返回"){
            goto i9;
        }
        else{
            ert();
            goto ir;
        }
    }
    else if(s=="3"||s=="设置"||s=="3.设置"){
        i2:
        cout<<"1.开关机/重启是否显示画面\n2.恢复出厂设置\n3.换颜色\n4.浅色模式\n5.上次异常关机开机提示\n6.返回\n";
        getline(cin,s);
        clear();
        if(s=="1"||s=="开关机/重启是否显示画面\n"||s=="1.开关机/重启是否显示画面\n"){
            ii:
            cout<<"0.显示\n1.不显示\n";
            getline(cin,s);
            FILE *kj=fopen("kj","w");
            if(s=="0"||s=="0.显示"||s=="显示"){
                fprintf(kj,"%d",0); 
                kjhm=0;
            }
            else if(s=="1"||s=="1.不显示"||s=="不显示"){
                fprintf(kj,"%d",1); 
                kjhm=1;
            }
            else{
                ert();
                goto ii;
            }
            clear();
            fclose(kj);
        }
        else if(s=="2"||s=="恢复出厂设置"||s=="2.恢复出厂设置"){
            cout<<"确定请输入1";
            char c=getchar(); 
            if(c=='1'){
                FILE *kj=fopen("kj","w");
                fprintf(kj,"%d",0); 
                fclose(kj);
                gjff();
                pro();
                system("color 00");
                csh();
                return 1;
            }
        }
        else if(s=="3"||s=="换颜色"||s=="3.换颜色"){
            inae:
            cout<<"字符代表的颜色:\n"; 
            cout<<"0=黑色,1=蓝色,2=绿色,3=湖蓝色,4=红色,5=紫色,6=**,7=白色,8=灰色,9=淡蓝色,A=淡绿色,B=浅绿色,C=淡红色,D=淡紫色,E=淡**,F=亮白色。";
            cout<<"\n请输入背景颜色(上面给出的)";
            string s,y;
            cin>>s;
            if(!(s.size()==1&&(s[0]>='0'&&s[0]<='9'||s[0]>='A'&&s[0]<='F'||s[0]>='a'&&s[0]<='f'))){
                system("cls");
                ert();
                goto inae;
            }
            if(s[0]>='a'&&s[0]<='f')s[0]-=32;
            system("cls");
            inbe:
            cout<<"字符代表的颜色:\n"; 
            cout<<"0=黑色,1=蓝色,2=绿色,3=湖蓝色,4=红色,5=紫色,6=**,7=白色,8=灰色,9=淡蓝色,A=淡绿色,B=浅绿色,C=淡红色,D=淡紫色,E=淡**,F=亮白色。";
            cout<<"\n请输入文字颜色(上面给出的)";
            cin>>y;
            if(!(y.size()==1&&(y[0]>='0'&&y[0]<='9'||y[0]>='A'&&y[0]<='F'||y[0]>='a'&&y[0]<='f'))){ 
                system("cls");
                ert();
                goto inbe;
            }
            if(y[0]>='a'&&y[0]<='f')y[0]-=32;
            color=s+y;
            clear();
            string t="color "+s+y;
            system(t.c_str());
            FILE* cl=fopen("color","w");
            fprintf(cl,color.c_str());
            fclose(cl);
        }
        else if(s=="4"||s=="浅色模式"||s=="4.浅色模式"){
            i10:
            cout<<"0.关闭\n1.开启\n";
            string y;
            getline(cin,y);
            FILE* qsmd=fopen("qs","w"); 
            if(y=="0"||y=="关闭"||y=="0.关闭"){
                fprintf(qsmd,"%d",0);
                FILE* cl=fopen("color","r");
                char x=getc(cl),y=getc(cl);
                string ans="color ";
                ans+=x;
                ans+=y;
                system(ans.c_str());
                fclose(cl);
            }
            else if(y=="1"||y=="1.开启"||y=="开启"){
                fprintf(qsmd,"%d",1);
                system("color 70"); 
            }
            else{
                ert();
                goto i10;
            }
            fclose(qsmd);
        }
        else if(s=="5"||s=="上次异常关机开机提示"||s=="5.上次异常关机开机提示"){
            i14:
            cout<<"0.开启\n1.关闭\n";
            string y;
            getline(cin,y);
            FILE* file=fopen("tpys","w"); 
            if(y=="0"||y=="开启"||y=="0.开启"){
                fprintf(file,"%d",0);
            }
            else if(y=="1"||y=="关闭"||y=="1.关闭"){
                fprintf(file,"%d",1);
            }
            else{
                ert();
                goto i14;
            }
            fclose(file);
        }
        else if(s=="6"||s=="返回"||s=="6.返回"){
            goto i9;
        }
        else{
            ert();
            goto i2;
        }
    }
    else{
        ert();
        goto i9;
    }
    return 2;
}
void clear(){
    system("cls");
    clear_cin();
}
string getver(bool flag){
    string a="LOS 3.0(Build 2433)\n",b="(Build 2433)\n编译日期2022/12/25\n按Enter继续";
    if(flag){
        cout<<a<<b;
        getchar();
        clear();
    }
    return a;
}
void startup(int type){
    if(kjhm)return;
    if(type==1||type==2){
        shutdown(type);
        return;
    }
    for(int i=1;i<=1;i++){
        string s="\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |__\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |___\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |____\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_____\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |______\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_______\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |__________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |___________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |____________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    cout<<"正在启动LOS";
    Sleep(166);
    clear();
    }
    Sleep(500);
}
void shutdown(int type){
    if(kjhm)return;
    for(int i=1;i<=1;i++){
    string s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |____________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |___________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |__________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |________\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_______\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |______\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_____\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |____\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |___\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |__\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |_\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        |\n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        |\n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        |\n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        |\n\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(60);
    clear();
    s="\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\
        \n\n\n\n\n\n";
    cout<<s;
    cout<<"        ";
    if(type==1)cout<<"正在关闭LOS";
    else cout<<"正在重新启动"; 
    Sleep(166);
    clear();
    }
    Sleep(500);
}
void s_d(int n){
    Sleep(n);
    cout<<".";
}
void notebook(){
    string s="",t="";
    clear();
    system("title LOS中的小小记事本");
    cout<<"小小记事本1.0\n";
    cout<<"编译日期:2022/11/28\n"; 
    cout<<"按Ctrl+Z停止输入\n";
    while(getline(cin,t)){
        s+=t+'\n';
    }
    cin.clear();
    cout<<"\n文件目录:";
    string a;
    getline(cin,a);
    cout<<"\n文件名(加后缀名):";
    string r;
    getline(cin,r);
    a+=r;
    FILE* fp=fopen(a.c_str(),"w");
    fprintf(fp,s.c_str());
    fclose(fp);
    cout<<"写入完成!";
    Sleep(666);
}
void setname(){
    string r="title "+getver(false);
    system(r.c_str()); 
}
void csh(){
    FILE* kj=fopen("kj","r");
    fscanf(kj,"%d",&kjhm);
    fclose(kj);
    FILE* yc=fopen("Type","w");
    fprintf(yc,"%d",1);
    fclose(yc);
    if(!qspd()){
        FILE* ys=fopen("color","r");
        char s;
        s=getc(ys);
        color+=s;
        s=getc(ys);
        color+=s;
        if(color[0]==' ')color="00";
        if(color=="")color="00";
        string t="color "+color;
        system(t.c_str()); 
        fclose(ys);
    }
    else system("color 70");
}
void ramtst(bool flag){
    p=(char*)malloc(157374182);
    for(int j=0;j<157374182;j++)p[j]=1;
    if(p!=NULL){
        if(flag){
            cout<<"测试成功,能够正常运行LOS!\n";
            Sleep(1000);
        }
    }
    else{
        cout<<"错误:剩余内存过少,可能无法正常运行LOS!";
        exit(1);
    }
    free(p);
    clear();
}
int q(char number){
    if(number<='9')return number-48;
    return number-55;
}
int f(string a,int k){
    int n=0;
    for(int i=0;i<a.size();i++){
        n=n*k+q(a[i]);
    }
    return n;
}
int n;
string s;
int jz;
char _p(int number){
    if(number<10)return number+48;
    return number+55;
}
string g(int n,int jz){
    string s="";
    while(n){
        s=_p(n%jz)+s;
        n/=jz;
    }
    return s;
}
void jzzh(){
    cout<<"请输入需要转换的数的进制n";
    cin>>n;
    cout<<"请输入需要转换的数s"; 
    cin>>s;
    cout<<"请输入要转换到的进制";
    cin>>jz;
    int ans=f(s,n);
    cout<<g(ans,jz);
}
void gtuser(){
    FILE * usnmfp=fopen("usnum","r");
    FILE * usfp=fopen("user","r");
    fscanf(usnmfp,"%d",&n);
    for(int i=2;i<=n;i++){
        fscanf(usfp,"%s%s",&user[i][0],&user[i][1]);
    }
    n++;
}
void login(){
    #if NTUSER
    return;
    #endif
    if(n==1){
        if(user[1][1]=="")return;
        cout<<"Welcome,"<<user[1][0]<<"!";
        Sleep(500);
        return;
    }
    //cout<<"请选择用户"
}
void gjff(){
    FILE* yc=fopen("Type","w");
    fprintf(yc,"%d",0);
    fclose(yc);
}
void read_Type(){
    if(pd2())return;
    FILE * yc=fopen("Type","r");
    int eeeee=0;
    fscanf(yc,"%d",&eeeee);
    if(eeeee==1){
        last_normal_shutdown();
    }
    fclose(yc);
}
void last_normal_shutdown(){
    cout<<"**:上一次未正常关闭LOS,可能会出现异常\n";
    cout<<"恢复出厂设置输入1,否则输入其它字符\n";
    char c=getchar();
    clear();
    if(c=='1'){
        FILE *kj=fopen("kj","w");
        fprintf(kj,"%d",0); 
        fclose(kj);
        gjff();
        pro();
        csh();
        cout<<"恢复完成!";
        Sleep(500);
        clear();
        return;
    } 
    clear();
}
void ert(){
    MessageBeep(MB_ICONERROR);
}
void pro(){
    FILE* cl=fopen("color","w");
    fprintf(cl,"07");
    fclose(cl);
    system("color 07");
}
void puanduan(){
    ifstream fout("nf");
    int n=0;
    fout>>n;
    if(n==0){
        pro();
        otpt();
        FILE * yc=fopen("Type","w");
        fprintf(yc,"%d",0);
        fclose(yc); 
    }
}
void otpt(){
    ofstream fout("nf");
    fout<<1;
}
bool qspd(){
    ifstream qsmd("qs");
    int n;
    qsmd>>n;
    return n; 
}
int pd2(){
    FILE* file=fopen("tpys","r");
    int n;
    fscanf(file,"%d",&n);
    fclose(file);
    return n;
}

 


0
已采纳
沙宸安
沙宸安
高级启示者
高级启示者

我觉得加上一些系 统自带的小工具会更好,比如说计时器。数学工具我觉得可以带上分数计算器,我这个账号发布的第一条帖子就是一个范例

或者你可以来点高级的玩法,我以前开发的XA-codingtang操作**就有绘图功能

开机密码是不是要来一个?

0
李宜和
李宜和
高级启示者
高级启示者

多加些功能,再加上存档就好了

你这代码至少40%都是头文件和开关机

 

我一向支持原创,反对拼接怪

我要回答