x山书院欢迎你

· · 休闲·娱乐

信息课搓的小游戏+1

有许多发癫成分在,勿喷谢谢

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
int cnt;
const double hards1=2,hards2=sqrt(sqrt(hards1));
struct student {
    int yuwen;
    int shuxue;
    int yingyu;
    int wuli;
    int shehui;
};
void BAD_END() {
    int ms=MessageBox(NULL,"你失败了!你被踢出了x山书院!","cqf",MB_ICONQUESTION|MB_YESNO );
    if(ms==IDNO)return ;
    system("cls");
    puts("x山拒绝了你的访问");
    exit(0);
}
void Student_cout(student a) {
    system("cls");
    puts("你在上一次考试的成绩如下");
    printf("语文:%d\n数学:%d\n英语:%d\n物理:%d\n社会:%d\n",a.yuwen,a.shuxue,a.yingyu,a.wuli,a.shehui);
    int sum=a.shehui+a.shuxue+a.wuli+a.yingyu+a.yuwen;
    if(sum<400)puts("这学期你VERY危险,有概率被踢出");
    else if(sum<450)puts("这学期你VERY危险,有概率吃一张黄单");
    else puts("这学期你大概率还活着");
    puts("输入空格以回到页面");
    char ch;
    while(ch=getch()) {
        if(ch==' ')break;
    }
    system("cls");
}
int check_student(student a) {
    int sum=a.shehui+a.shuxue+a.wuli+a.yingyu+a.yuwen;
    if(sum<400)return 2;
    if(sum<450)return 1;
    return 0;
}
int main() {
    while(1) {
        cnt=0;
        srand(time(0));
        puts("这是你的面板数据:(输入c以查看)");
        char ch;
        while(ch=getch()) {
            if(ch=='c'||ch=='C')break;
            else puts("请输入c");
        }
        student Player= {rand()%31+70,rand()%11+90,rand()%11+90,rand()%11+90,rand()%21+80};
        Student_cout(Player);
        int fl=0,cnt=0;
        while(fl<=1) {
            //cout<<fl<<endl;
            int days=rand()%50,times;
            if(cnt==0) {
                cnt++;
                system("cls");
                puts("这是一个模拟X山书院的小游戏");
                Sleep(1145);
                system("cls");
                puts("你要尽力留在模拟的X山书院");
                Sleep(1145); 
                system("cls");
                puts("X山书院有繁重的学业,但你学习的时间有限,你要分配时间给五门主课");
                Sleep(1145); 
                system("cls");
                puts("X山书院有繁重的学业,但你学习的时间有限,你要分配时间给五门主课");
                Sleep(1145); 
                system("cls");
                continue;
            }
            printf("这次你有%d天进行学习\n你可以思考如何分配学习天数,决定好了就按空格键吧",days);
            while(ch=getch()) {
                if(ch==' ')break;
                else puts("请输入空格");
            }
            system("cls");
            printf("你要在语文上花多少时间?\n");
            scanf("%d",&times);
            while(times>days) {
                printf("输入的天数大于剩余天数,你仅剩%d天可分配\n",days);
                scanf("%d",&times);
            }
            days-=times;
            Player.yuwen=(Player.yuwen+times*hards1)/hards2;
            system("cls");
            printf("你要在数学上花多少时间?\n");
            scanf("%d",&times);
            while(times>days) {
                printf("输入的天数大于剩余天数,你仅剩%d天可分配\n",days);
                scanf("%d",&times);
            }
            days-=times;
            Player.shuxue=(Player.shuxue+times*hards1)/hards2;
            system("cls");
            printf("你要在英语上花多少时间?\n");
            scanf("%d",&times);
            while(times>days) {
                printf("输入的天数大于剩余天数,你仅剩%d天可分配\n",days);
                scanf("%d",&times);
            }
            days-=times;
            Player.yingyu=(Player.yingyu+times*hards1)/hards2;
            system("cls");
            printf("你要在物理上花多少时间?\n");
            scanf("%d",&times);
            while(times>days) {
                printf("输入的天数大于剩余天数,你仅剩%d天可分配\n",days);
                scanf("%d",&times);
            }
            days-=times;
            Player.wuli=(Player.wuli+times*hards1)/hards2;
            system("cls");
            printf("你要在社会上花多少时间?\n");
            scanf("%d",&times);
            while(times>days) {
                printf("输入的天数大于剩余天数,你仅剩%d天可分配\n",days);
                scanf("%d",&times);
            }
            days-=times;
            Player.shehui=(Player.shehui+times*hards1)/hards2;
            system("cls");
            Student_cout(Player);
            fl+=check_student(Player);
        }
        BAD_END();
    }

    return 0;
}