1017A.The Rank#排名

題目出處:http://codeforces.com/problemset/problem/1017/A
#include<iostream>
using namespace std;
int main(){
    int English,German,Math,History;
    int i,n,sum,rank;
    cin>>n;
    rank=1;
    for(i=0;i<n;i++){
        cin>>English>>German>>Math>>History;
        if(!i)
            sum = English+German+Math+History;
        else
            if(sum<English+German+Math+History)rank++;
    }
    cout<<rank;
    return 0;
}
相關文章
相關標籤/搜索