跳到正文

科技·工程

我的程序

purplepolarstar约 4 分钟
原文
文章信息与版本

文章信息

发布
2025年1月13日
收录
2025年12月12日
更新
2026年11月8日
篇幅
约 4 分钟

版本

  1. v1当前
C++
//用于文理分科 2024:1:14,执行即可(建议在Dev-C++上)
//created by linjingyi
#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,chi,e,ph,che,h,b,g,po,n;
    string interest;
    cout<<"Hello,I am your personal subject sllection suggestion robot.'-'"<<endl;
    cout<<"To help you choose your subject,please enter the following information correctly!^-^"<<endl;
    cout<<"Please enter your score ranking:"<<endl;
    cout<<"First of all,the number of students int your grade,please: ";cin>>n;cout<<endl;
    cout<<"Math: ";cin>>m;cout<<endl;
    cout<<"Chinese: ";cin>>chi;cout<<endl;
    cout<<"English: ";cin>>e;cout<<endl;
    cout<<"Physics: ";cin>>ph;cout<<endl;
    cout<<"Chemistry: ";cin>>che;cout<<endl;
    cout<<"History: ";cin>>h;cout<<endl;
    cout<<"Biology: ";cin>>b;cout<<endl;
    cout<<"Geography: ";cin>>g;cout<<endl;
    cout<<"Politics: ";cin>>po;cout<<endl;
    cout<<"Calculating...Please wait a moment>-<"<<endl;
    cout<<"Oh~Sorry,I forget one more thing your interest!Please tell me,to give you the best choice,OK?^_^";
    cout<<endl;cout<<"Please enter your interest(ART or SCIENCE)";cin>>interest;
    if(m+ph+che+b<=n*4/10&&interest=="SCIENCE") cout<<"Acording to all your information,I highly reccmend you to choose SCIENCE as your derction,and and choose Math,Chinese,English,Physics,Chemistry and Biology as your subject."<<endl;
    else{
        if (interest=="SCIENCE") cout<<"I've seen that you are interested in SCIENCE,however ,although acorrding to your interest I suggest you to choose the SCIENCE as your subject,I believe that to achieve your goal,you should study harder to improve your SCIENCE.Also,if possible ,choose one of the ART subjects just to put your scores higher,OK?"<<endl;
        else {
            cout<<"Choose ART subjects.If possible ,choose some SCIENCE subjects,just in case to improve your scores!"<<endl;
        }
    }
    cout<<"Sencierly hope you can get good grades!Bye!"<<endl;
    return 0;
}
原文