我服了,求大神

'''c++
#include<iostream>
#include<utility>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
string name[106];
int qc[106];
int bc[106];
bool xb[106];
bool xx[106];
bool lw[106];
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>name[i]>>qc[i]>>bc[i];
char b;
cin>>b; b=='Y'? xx[i]=true:xx[i]=false;
cin>>b; b=='Y'? xb[i]=true:xb[i]=false;
cin>>b; b!='0'? lw[i]=true:lw[i]=false;
}
int i,id=0;
int count=0;
int count1=0;
for(i=0;i<n;i++){
int cot=0;
if(qc[i]>80&&lw[i]) cot+=8000;
if(qc[i]>85&&bc[i]>80) cot+=4000;
if(qc[i]>90) cot+=2000;
if(qc[i]>85&&xb[i]) cot+=1000;
if(bc[i]>80&&xx[i]) cot+=850;
count1+=cot;
if(cot>count) {id=i;count=cot;}
}
cout<<name[id]<<endl<<count<<endl<<count1;
return 0;
}'''

4 条评论

  • @ 2016-08-06 11:29:33

    草草擦

  • @ 2016-07-23 13:31:41

    `不是'

  • @ 2016-07-23 10:20:43

    编的不好让你们见笑了

  • @ 2016-07-23 10:20:10

    #include<stdio.h>
    #include<string.h>
    #include<iostream>
    using namespace std;
    long long n,total=0;
    int q;
    struct
    {
    char s[21];
    int fen,Class,ganbu,xibu,lunwen;
    long monny;
    }xyz[101];
    void putin()
    {
    int i;
    scanf("%lld",&n);
    for(i=1;i<=n;i++){
    char a1,b1;
    scanf("%s %d %d %c %c %d",&xyz[i].s,&xyz[i].fen,&xyz[i].Class,&a1,&b1,&xyz[i].lunwen);
    if(a1=='Y')
    xyz[i].ganbu=1;
    else
    xyz[i].ganbu=0;
    if(b1=='Y')
    xyz[i].xibu=1;
    else
    xyz[i].xibu=0;
    }
    }
    void work()
    {
    int i;
    for(i=1;i<=n;i++)
    xyz[i].monny=0;
    for(i=1;i<=n;i++){
    if(xyz[i].fen>80 && xyz[i].lunwen>=1)
    xyz[i].monny+=8000;
    if(xyz[i].fen>85 && xyz[i].Class>80)
    xyz[i].monny+=4000;
    if(xyz[i].fen>90)
    xyz[i].monny+=2000;
    if(xyz[i].fen>85 && xyz[i].xibu==1)
    xyz[i].monny+=1000;
    if(xyz[i].Class>80 && xyz[i].ganbu==1)
    xyz[i].monny+=850;
    total+=xyz[i].monny;
    }
    }
    void work2()
    {
    long Max=0;
    int i;
    for(i=1;i<=n;i++)
    if(xyz[i].monny>Max){
    q=i;
    Max=xyz[i].monny;

    }

    }
    void putout()
    {
    printf("%s\n",&xyz[q].s);
    cout<<xyz[q].monny<<"\n";
    cout<<total;
    }
    int main()
    {
    putin();
    work();
    work2();
    putout();
    return 0;
    }

  • 1

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
39260
已通过
12791
通过率
33%
被复制
129
上传者