日志19

学生成绩输入及统计输出

#include<iostream>
#include<string>
using namespace std;
struct Student{
    string name;
    int programmingScore;
    int mathScore;
    int englishScore;
};
int main(){
    int n;
    cin>>n;
    Student students[n];
    for(int i=0;i<n;i++){
        cin>>students[i].name>>students[i].programmingScore>>students[i].mathScore>>students[i].englishScore;
    }
    for (int i=0;i<n;i++){
        int totalScore=students[i].programmingScore+students[i].mathScore+students[i].englishScore;
        cout<<students[i].name<<" "<<totalScore<<endl;
    }
    return 0;
}

全部评论

相关推荐

05-16 21:54
已编辑
门头沟学院 前端工程师
蓝曦111:我也是25届,这是第二次被裁了,毕业没到一年就失业两次,两次都是公司问题。第一家才转正一个月,跟我说公司拿不到项目结款没办法,赔了一个月;第二个公司连工资都发不出来了,赔偿更别想了,我算是认命了,这条路也不知道能走多远走多久,不过生活还是要继续的,走一步看一步吧
当你面对裁员会如何?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务