陈朋飞


私信TA

用户名:fgzsfgzs

访问量:7812

签 名:

等  级
排  名 161
经  验 6898
参赛次数 0
文章发表 73
年  龄 21
在职情况 学生
学  校 南昌工程学院
专  业 通信 兼修 计算机

  自我简介:

欢迎加我QQ进行交流:2148491591,本人 C语言,C++,JAVA都会一点

TA的其他文章

解题思路:

注意事项:

参考代码:

#include <iostream>

#include<cstdio>

#include<cstring>

#include<set>

#include<string>

#include<vector>

#include<algorithm>

using namespace std;

struct student

{

    string name;

    int cj1;

    int cj2;

    char a;

    char b;

    int t;

};

int main()

{

    struct student s[100];

    int n, c[100] = {0},tot,sum=0;

    cin >> n;

    for (int i = 0; i < n; i++)

        cin >> s[i].name >> s[i].cj1 >> s[i].cj2 >> s[i].a >> s[i].b >> s[i].t ;

    for (int i = 0; i < n; i++)

    {

        if (s[i].cj1 > 80 && s[i].t >= 1)

            c[i] += 8000;

        if (s[i].cj1 > 85 && s[i].cj2 > 80)

            c[i] += 4000;

        if (s[i].cj1 > 90)

            c[i] += 2000;

        if (s[i].cj1 > 85 && s[i].b=='Y')

            c[i] += 1000;

        if (s[i].cj2 > 80 && s[i].a == 'Y')

            c[i] += 850;

        tot = max(tot,c[i]);

        sum += c[i];

    }

    for (int i = 0; i < n; i++)

        if (tot == c[i])

        {

            cout << s[i].name << endl;

            cout << tot << endl;

            cout << sum << endl;

            break;

        }

    

    return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区