511 条题解

  • 0
    @ 2016-08-13 14:15:56

    C++简单易懂结构体:

    #include <string>
    #include <iostream>
    using namespace std;
    struct Person
    {
    string name;
    int aver;
    int com;
    char isl;
    char isw;
    int num;
    int sum1;
    };
    Person person[100];
    int main()
    {
    int n,sum2=0,i;
    cin>>n;
    for(i=0;i<n;i++)
    {
    person[i].sum1=0;
    cin>>person[i].name>>person[i].aver>>person[i].com>>person[i].isl
    >>person[i].isw>>person[i].num;

    if(person[i].aver>80&&person[i].num>=1)
    {
    person[i].sum1+=8000;
    sum2+=8000;
    }
    if(person[i].aver>85&&person[i].com>80)
    {
    person[i].sum1+=4000;
    sum2+=4000;
    }
    if(person[i].aver>90)
    {
    person[i].sum1+=2000;
    sum2+=2000;
    }
    if(person[i].aver>85&&person[i].isw=='Y')
    {
    person[i].sum1+=1000;
    sum2+=1000;
    }
    if(person[i].com>80&&person[i].isl=='Y')
    {
    person[i].sum1+=850;
    sum2+=850;
    }

    }
    string str2=person[0].name;
    int sum3=person[0].sum1;
    for(i=1;i<n;i++)
    {
    if(person[i].sum1>sum3)
    {
    str2=person[i].name;
    sum3=person[i].sum1;
    }
    }

    cout<<str2<<endl;
    cout<<sum3<<endl;
    cout<<sum2<<endl;

    return 0;
    }

  • 0
    @ 2016-08-10 13:44:07

    模拟.

    c++ code

    #include <iostream>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    using namespace std;

    int main()
    {
    int a,b,c,n,i,money,sum,maxn; char name[100],x[100],y[100],boss[100];
    scanf("%d",&n); sum=0; maxn=0;
    for(i=1;i<=n;i++){
    money=0;
    scanf("%s%d%d%s%s%d",&name,&a,&b,&x,&y,&c);
    if(a>80 && c>=1){money=money+8000;}
    if(a>85 && b>80){money=money+4000;}
    if(a>90){money=money+2000;}
    if(a>85 && strcmp(y, "Y")==0){money=money+1000;}
    if(b>80 && strcmp(x, "Y")==0){money=money+850;}
    if(money>maxn){
    strcpy(boss,name); maxn=money;
    }
    sum=sum+money;
    }
    printf("%s\n%d\n%d",boss,maxn,sum);
    return 0;
    }

  • 0
    @ 2016-07-31 19:34:14

    这题实在简单啊……连普及组难度都不及啊……提高组考语言篇吗?
    c++
    #include <iostream>
    #include <iomanip>
    #include <cstring>
    using namespace std;
    int n;
    int ans(int point1,int point2,bool work,bool west,int art)
    {
    int re=0;
    if(art>=1&&point1>80)
    re+=8000;
    if(point2>80&&point1>85)
    re+=4000;
    if(point1>90)
    re+=2000;
    if(point1>85&&west==true)
    re+=1000;
    if(point2>80&&work==true)
    re+=850;
    return re;
    }
    int main()
    {
    cin>>n;
    char ans_name[25];
    int maxmoney=0,allmoney=0,i=n;
    while(i--)
    {
    char inname[25],work1,west1;
    int point1,point2,art;
    bool work,west;
    cin>>inname>>point1>>point2>>work1>>west1>>art;
    if(work1=='Y')
    work=true;
    else
    work=false;
    if(west1=='Y')
    west=true;
    else
    west=false;
    int money=ans(point1,point2,work,west,art);
    allmoney+=money;
    if(money>maxmoney)
    {
    maxmoney=money;
    strcpy(ans_name,inname);
    }
    }
    cout<<ans_name<<endl<<maxmoney<<endl<<allmoney;
    return 0;
    }

  • 0
    @ 2016-07-23 13:42:58

    #include <iostream>
    #include <string>
    #include <cmath>
    using namespace std;
    int main(){
    int n;cin>>n;int maxx = 0;string maxname;int tosum = 0;
    string name;int qimo;int banji;char ganbu;char xibu;int lunwen;
    for(int i=1;i<=n;i++){
    int sum = 0;
    cin>>name>>qimo>>banji>>ganbu>>xibu>>lunwen;
    if (qimo > 80 && lunwen >= 1){
    sum=sum+8000;
    }
    if (qimo > 85 && banji > 80){
    sum=sum+4000;
    }
    if (qimo > 90){
    sum=sum+2000;
    }
    if (qimo > 85 && xibu =='Y'){
    sum=sum+1000;
    }
    if (banji > 80 && ganbu == 'Y'){
    sum=sum+850;
    }
    if (sum>maxx){
    maxx = sum;
    maxname = name;
    }
    tosum=tosum + sum ;

    }
    cout<<maxname<<endl;
    cout<<maxx<<endl;
    cout<<tosum<<endl;
    return 0;}

  • 0
    @ 2016-07-22 16:02:36

    fssdgf

    • @ 2016-07-22 16:03:33

      不小心发出去的,麻烦管理帮忙删了
      谢谢

    • @ 2016-10-05 15:56:43

      结果还是没删2333333

  • 0
    @ 2016-07-22 16:02:12

    其实很简单,记录类型就ac,就是读入有点麻烦
    ```pascal

    program fds;
    type jilu=record
    names:array[1..100] of char;
    kaofen:longint;
    banfen:longint;
    bangb:char;
    xibu:char;
    runwen:longint;
    zong:longint;
    xu:longint;
    chang:longint;
    end;
    var a:array[1..101] of jilu;
    i,j,k,l,v,s,t,o,n,g:longint;
    begin

    readln(n);
    for i:=1 to n do
    begin
    g:=0;
    repeat
    g:=g+1;
    read(a[i].names[g]);
    until a[i].names[g]=' ';
    a[i].chang:=g-1;

    readln(a[i].kaofen,a[i].banfen,a[i].bangb,a[i].bangb,a[i].xibu,a[i].xibu,a[i].runwen);
    if (a[i].kaofen>80) and (a[i].runwen>=1) then a[i].zong:=8000+a[i].zong;
    if (a[i].kaofen>85) and (a[i].banfen>80) then a[i].zong:=4000+a[i].zong;
    if (a[i].kaofen>90) then a[i].zong:=2000+a[i].zong;
    if (a[i].kaofen>85) and (a[i].xibu='Y')then a[i].zong:=1000+a[i].zong;
    if (a[i].banfen>80) and (a[i].bangb='Y') then a[i].zong:=850+a[i].zong;
    a[i].xu:=i;
    end;
    v:=0;
    s:=0;
    o:=0;
    for i:=1 to n do begin
    o:=o+a[i].zong;
    if a[i].zong>s then begin v:=a[i].xu; s:=a[i].zong; end;end;
    for i:=1 to a[v].chang do write(a[v].names[i]);writeln;
    writeln(a[v].zong);
    writeln(o);
    end.```

  • 0
    @ 2016-07-16 21:07:14

    最简单的选择分支,一个个写就行了

    #include<iostream>
    using namespace std;
    int main()
    {
        string a,g;
        int b,c,f,n,money=0,result=0,sum=0;
        char d,e;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            cin>>a>>b>>c>>d>>e>>f;
            money=0;
            if(b>80&&f>=1)
            money+=8000;//院士奖学金
            if(b>85&&c>80)
            money+=4000;//五四奖学金
            if(b>90)
            money+=2000;//成绩优秀奖
            if(b>85&&e=='Y')
            money+=1000;//西部奖学金
            if(c>80&&d=='Y')
            money+=850;//班级贡献奖
            sum+=money;//奖金总和
            if(result<money)
            {
                result=money;
                g=a;//记录名字
            }
        }
        cout<<g<<endl<<result<<endl<<sum<<endl;
        return 0;
    }```
    
  • 0
    @ 2016-07-16 21:05:48

    最简单的选择分支,一个个写就行了

  • 0
    @ 2016-07-04 16:25:42

    测试数据 #0: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    测试数据 #4: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #5: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #6: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #7: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    测试数据 #8: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    测试数据 #9: Accepted, time = 0 ms, mem = 492 KiB, score = 10
    Accepted, time = 0 ms, mem = 492 KiB, score = 100

    C:

    #include <stdio.h>

    int main() {
    struct stu{
    char name[20];
    int num1;
    int num2;
    char ch1;
    char ch2;
    int num3;
    int sum;
    } str[101];
    int n, i;
    scanf("%d", &n);
    for(i=0; i<n; i++) {
    scanf("\n");
    scanf("%s", &str[i].name);
    scanf("%d", &str[i].num1);
    scanf("%d", &str[i].num2);
    scanf(" ");
    scanf("%c", &str[i].ch1);
    scanf(" ");
    scanf("%c", &str[i].ch2);
    scanf("%d", &str[i].num3);
    }
    for(i=0; i<n; i++) {
    str[i].sum = 0;
    if(str[i].num1>80 && str[i].num3>=1) str[i].sum+=8000;
    if(str[i].num1>85 && str[i].num2>80) str[i].sum+=4000;
    if(str[i].num1>90) str[i].sum+=2000;
    if(str[i].num1>85 && str[i].ch2=='Y') str[i].sum+=1000;
    if(str[i].num2>80 && str[i].ch1=='Y') str[i].sum+= 850;
    }
    long max=0, sum1=0;
    for(i=0; i<n; i++) {
    if(str[i].sum > str[max].sum) max = i;
    sum1 += str[i].sum;
    }
    printf("%s\n%ld\n%ld", str[max].name, str[max].sum, sum1);
    return 0;
    }

  • 0
    @ 2016-06-21 13:01:36

    #include<stdio.h>
    #include<string.h>
    struct student
    {
    char name[100];
    int ascore;
    int cscore;
    char cadre;
    char west;
    int paper;
    int money;
    }stu[100];
    int main()
    {
    int n;
    int s=0;
    //int m=0;
    int t1;
    char t2[100],tmp[128];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    scanf("%s %d %d %c %c %d",stu[i].name,&stu[i].ascore,&stu[i].cscore,&stu[i].cadre,&stu[i].west,&stu[i].paper);
    for(int j=0;j<n;j++)
    {
    if(stu[j].ascore>80&&stu[j].paper>=1)
    stu[j].money+=8000;
    if(stu[j].ascore>85&&stu[j].cscore>80)
    stu[j].money+=4000;
    if(stu[j].ascore>90)
    stu[j].money+=2000;
    if(stu[j].ascore>85&&stu[j].west=='Y')
    stu[j].money+=1000;
    if(stu[j].cscore>80&&stu[j].cadre=='Y')
    stu[j].money+=850;
    }
    for(int j=0;j<n;j++)
    {
    for(int k=0;k<n;k++)
    {
    if(stu[k].money<stu[k+1].money)
    {
    t1=stu[k].money;
    stu[k].money=stu[k+1].money;
    stu[k+1].money=t1;
    strcpy(tmp,stu[k].name);
    strcpy(stu[k].name,stu[k+1].name);
    strcpy(stu[k+1].name,tmp);
    }
    }
    }
    for(int l=0;l<n;l++)
    {
    s+=stu[l].money;
    }
    printf("%s\n%d\n%d",stu[0].name,stu[0].money,s);
    return 0;
    }

  • 0
    @ 2016-05-29 10:45:05
    #include<stdio.h>
    #include<string.h>
    int sum=0,sum1=0,sum2=0;
    void check(int ,int ,char ,char ,int);
    void D(char *,char *);
    int main()
    {
        freopen("1.in","r",stdin);
        int n=0;
        scanf("%d",&n);
        char name[30]={'\0'},name1[30]={'\0'},z='\0',z1='\n',w;
        int endg=0,endp=0,lw=0;
        for(int i=0;i<n;i++)
        {
            scanf("%s",name1);
            scanf("%d",&endg);
            scanf("%d",&endp);
            scanf("%c%c",&w,&z);
            scanf("%c%c",&w,&z1);
            scanf("%d",&lw);
            check(endg,endp,z,z1,lw);
            if(sum2>sum)
            {
                sum=sum2;
                D(name,name1);
            }
            sum2=0;
            endg=0;
            endp=0;
            lw=0;
        }
        printf("%s\n%d\n%d\n",name,sum,sum1);
    }
    void check(int a,int b,char a1,char b1,int c)
    {
        if(a>80&&c>0)
        {
            sum1+=8000;
            sum2+=8000;
        }
        if(a>85&&b>80)
        {
            sum1+=4000;
            sum2+=4000;
        }
        if(a>90)
        {
            sum1+=2000;
            sum2+=2000;
        }
        if(a>85&&b1=='Y')
        {
            sum1+=1000;
            sum2+=1000;
        }
        if(b>80&&a1=='Y')
        {
            sum1+=850;
            sum2+=850;
        }
    }
    void D(char *a,char *b)
    {
        for(int i=0;i<30;i++)
            a[i]=b[i];
    }
    

    哪里错了?请大神指教

  • 0
    @ 2016-05-21 19:49:55

    var
    i,j,max,n,t,sum:longint;
    nam:array[0..101] of string;
    ch1,ch2:array[0..101] of string;
    c1,c2,mon,l:array[0..101] of longint;
    k,s:string;
    begin
    readln(n);
    max:=-1;
    for i:=1 to n do
    begin
    readln(s);
    s:=s+' ';
    t:=pos(' ',s);
    nam[i]:=copy(s,1,t-1); //youbian zifuchuan
    delete(s,1,t);

    sum:=0;
    t:=pos(' ',s);
    k:=copy(s,1,t-1);
    delete(s,1,t);
    for j:=1 to length(k) do
    sum:=sum*10+ord(k[j])-48;
    c1[i]:=sum;

    sum:=0;
    t:=pos(' ',s);
    k:=copy(s,1,t-1);
    delete(s,1,t);
    for j:=1 to length(k) do
    sum:=sum*10+ord(k[j])-48;
    c2[i]:=sum;

    t:=pos(' ',s);
    ch1[i]:=copy(s,1,t-1);
    delete(s,1,t);

    t:=pos(' ',s);
    ch2[i]:=copy(s,1,t-1);
    delete(s,1,t);

    sum:=0;
    t:=pos(' ',s);
    k:=copy(s,1,t-1);
    delete(s,1,t);
    for j:=1 to length(k) do
    sum:=sum*10+ord(k[j])-48;
    l[i]:=sum;
    end;
    sum:=0;
    for i:=1 to n do
    begin
    if (c1[i]>80) and (l[i]>=1)
    then
    mon[i]:=mon[i]+8000;
    if (c1[i]>85) and (c2[i]>80)
    then
    mon[i]:=mon[i]+4000;
    if c1[i]>90
    then
    mon[i]:=mon[i]+2000;
    if (c1[i]>85) and (ch2[i]='Y')
    then
    mon[i]:=mon[i]+1000;
    if (c1[i]>80) and (ch1[i]='Y')
    then
    mon[i]:=mon[i]+850;
    end;
    for i:=1 to n do
    if mon[i]>max
    then
    begin
    max:=mon[i];
    k:=nam[i];
    end;
    for i:=1 to n do
    sum:=sum+mon[i];
    writeln(k);
    writeln(max);
    writeln(sum);
    readln;

    end.

  • 0
    @ 2016-05-14 19:12:02

    #include <iostream>
    #include <cstring>

    using namespace std;

    int ys(int a,int b){
    if(a>80&&b>=1)
    return 8000;
    else
    return 0;
    }

    int ws(int a,int b){
    if(a>85&&b>80)
    return 4000;
    else
    return 0;
    }

    int cj(int a){
    if(a>90)
    return 2000;
    else
    return 0;
    }

    int fxb(int a,char b){
    if(a>85&&b=='Y')
    return 1000;
    else
    return 0;
    }

    int fbj(int a,char b){
    if(a>80&&b=='Y')
    return 850;
    else
    return 0;
    }

    int main(){

    int total;
    cin>>total;

    string name[total];
    int qm[total],bj[total],paper[total];
    char gb[total],xb[total];

    for(int q=0;q<total;q++)
    cin>>name[q]>>qm[q]>>bj[q]>>gb[q]>>xb[q]>>paper[q];

    int money[total];
    for(int z=0;z<total;z++)
    money[z]=0;

    for(int qq=0;qq<total;qq++){
    money[qq]=ys(qm[qq],paper[qq])+ws(qm[qq],bj[qq])+cj(qm[qq])+fxb(qm[qq],xb[qq])+fbj(bj[qq],gb[qq]);
    }

    int s=0,n=0,all=0;
    for(int w=0;w<total;w++){
    all=all+money[w];
    if(s<money[w]){
    s=money[w];
    n=w;
    }
    }

    cout<<name[n]<<endl;
    cout<<money[n]<<endl;
    cout<<all;

    return 0;
    }

  • 0
    @ 2016-05-10 22:27:07

    """c
    #include <stdio.h>
    #define MAX_NUM 100
    #define MAX_LEN 22
    typedef struct information
    {
    char name[MAX_LEN];
    int end_grade;
    int class_grade;
    char Is_monitor;
    char Is_western;
    int article_number;
    int award_money;
    }Student;

    int main(void)
    {
    int students_number;
    scanf("%d",&students_number);
    Student students_catalog[students_number];
    int i;
    for(i=0;i<students_number;i++)
    {
    scanf("%s %d %d",students_catalog[i].name,&(students_catalog[i].end_grade),&(students_catalog[i].class_grade));
    getchar();
    scanf("%c %c %d",&(students_catalog[i].Is_monitor),&(students_catalog[i].Is_western),&(students_catalog[i].article_number));
    getchar();
    students_catalog[i].award_money=0;
    }
    int index=0;
    int money_max=0;
    int all_money=0;
    for(i=0;i<students_number;i++)
    {
    if(students_catalog[i].end_grade>80 && students_catalog[i].article_number>=1)
    students_catalog[i].award_money+=8000;
    if(students_catalog[i].end_grade>85 && students_catalog[i].class_grade>80)
    students_catalog[i].award_money+=4000;
    if(students_catalog[i].end_grade>90)
    students_catalog[i].award_money+=2000;
    if(students_catalog[i].end_grade>85 && students_catalog[i].Is_western=='Y')
    students_catalog[i].award_money+=1000;
    if(students_catalog[i].class_grade>80 && students_catalog[i].Is_monitor=='Y')
    students_catalog[i].award_money+=850;
    if(students_catalog[i].award_money>money_max)
    {
    money_max=students_catalog[i].award_money;
    index=i;
    }
    all_money+=students_catalog[i].award_money;
    }
    printf("%s\n",students_catalog[index].name);
    printf("%d\n",money_max);
    printf("%d\n",all_money);
    return 0;
    }
    """

  • 0
    @ 2016-05-10 22:26:30

    '''c
    #include <stdio.h>
    #define MAX_NUM 100
    #define MAX_LEN 22
    typedef struct information
    {
    char name[MAX_LEN];
    int end_grade;
    int class_grade;
    char Is_monitor;
    char Is_western;
    int article_number;
    int award_money;
    }Student;

    int main(void)
    {
    int students_number;
    scanf("%d",&students_number);
    Student students_catalog[students_number];
    int i;
    for(i=0;i<students_number;i++)
    {
    scanf("%s %d %d",students_catalog[i].name,&(students_catalog[i].end_grade),&(students_catalog[i].class_grade));
    getchar();
    scanf("%c %c %d",&(students_catalog[i].Is_monitor),&(students_catalog[i].Is_western),&(students_catalog[i].article_number));
    getchar();
    students_catalog[i].award_money=0;
    }
    int index=0;
    int money_max=0;
    int all_money=0;
    for(i=0;i<students_number;i++)
    {
    if(students_catalog[i].end_grade>80 && students_catalog[i].article_number>=1)
    students_catalog[i].award_money+=8000;
    if(students_catalog[i].end_grade>85 && students_catalog[i].class_grade>80)
    students_catalog[i].award_money+=4000;
    if(students_catalog[i].end_grade>90)
    students_catalog[i].award_money+=2000;
    if(students_catalog[i].end_grade>85 && students_catalog[i].Is_western=='Y')
    students_catalog[i].award_money+=1000;
    if(students_catalog[i].class_grade>80 && students_catalog[i].Is_monitor=='Y')
    students_catalog[i].award_money+=850;
    if(students_catalog[i].award_money>money_max)
    {
    money_max=students_catalog[i].award_money;
    index=i;
    }
    all_money+=students_catalog[i].award_money;
    }
    printf("%s\n",students_catalog[index].name);
    printf("%d\n",money_max);
    printf("%d\n",all_money);
    return 0;
    }
    '''

  • 0
    @ 2016-04-06 17:46:33

    #include <iostream>
    using namespace std;

    int main()
    {
    int n;
    cin >> n;
    int a[100][3];
    char b[100][21];
    char c[100][2];
    int m[100] = {0};
    for(int i = 0; i < n; i++ )
    {
    cin >> b[i];
    for(int j = 0; j< 2;j++)
    {
    cin >> a[i][j];
    }
    for(int j = 0; j < 2;j++)
    {
    cin >> c[i][j];
    }
    cin >> a[i][2];
    }
    for(int i = 0; i < n; i++)
    {
    if(a[i][0] > 80 && a[i][2] >=1 )
    m[i] += 8000;
    if(a[i][0] > 85 && a[i][1] > 80 )
    m[i] += 4000;
    if(a[i][0] > 90)
    m[i] += 2000;
    if(a[i][0] > 85 && c[i][1] == 'Y')
    m[i] += 1000;
    if(a[i][1] > 80 && c[i][0] == 'Y')
    m[i] += 850;
    }
    int total = 0;
    for(int i = 0; i <n; i++)
    {
    total += m[i];
    }
    int e =0;
    for (int i = 0; i< n;i++)
    {;
    if(m[e] < m[i])
    e = i;
    }
    cout << b[e] <<endl;
    cout << m[e] << endl;
    cout << total;
    system("pause");
    }

  • 0
    @ 2016-03-29 22:48:37

    import java.util.*;
    import static java.lang.System.*;
    public class Main{
    static Scanner in = new Scanner(System.in);

    public static void main(String[] args){
    int n;
    n=in.nextInt();
    String id = null;
    int mx=-1,sum=0;
    for(int i=0;i<n;i++)
    {
    in.nextLine();
    int award=0;
    String name=in.next();
    int score=in.nextInt();
    int mark=in.nextInt();
    String cadre=in.next();
    String isXB=in.next();
    int paples=in.nextInt();

    if(score>80&&paples>=1)
    award+=8000;
    if(score>85&&mark>80)
    award+=4000;
    if(score>90)
    award+=2000;
    if(score>85&&isXB.charAt(0)=='Y')
    award+=1000;
    if(mark>80&&cadre.charAt(0)=='Y')
    award+=850;
    if(award>mx)
    { id=name;
    mx=award;
    }
    sum+=award;
    }
    out.println(id);
    out.println(mx);
    out.println(sum);
    }
    }

  • 0
    @ 2016-03-23 13:19:38

    #include<cstdio>
    #include<iostream>
    #include<cstring>
    #include<algorithm>
    #define max 100000
    using namespace std;
    int tot[max];
    int maxn,sum,re;
    struct STU
    {
    string name;
    int gra1,gra2,pas;
    char a,b;
    }stu[max];
    int main()
    {
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    cin>>stu[i].name>>stu[i].gra1>>stu[i].gra2>>stu[i].a>>stu[i].b>>stu[i].pas;
    if(stu[i].gra1>80&&stu[i].pas) tot[i]+=8000;
    if(stu[i].gra1>85&&stu[i].gra2>80) tot[i]+=4000;
    if(stu[i].gra1>90) tot[i]+=2000;
    if(stu[i].gra1>85&&stu[i].b=='Y') tot[i]+=1000;
    if(stu[i].gra2>80&&stu[i].a=='Y') tot[i]+=850;
    }
    for(int i=1;i<=n;i++)
    {
    if(tot[i]>maxn) {maxn=tot[i]; re=i;}
    sum+=tot[i];
    }
    cout<<stu[re].name<<'\n'<<maxn<<'\n'<<sum;
    return 0;
    }

  • 0
    @ 2016-03-15 17:40:33

    include<iostream>
    include<algorithm>
    include<cstdio>
    include<stdio.h>
    using namespace std;
    bool flag=true;int s;
    struct sdd{
    char name[101];
    int qimo;
    int banji;
    char ganbu;
    char xibu;
    int lunwen;
    int jj;
    }a[101];
    int comp(const sdd&a,const sdd&b){
    return a.jj>b.jj;
    }
    int main(){
    int n;cin>>n;
    for(int i=1;i<=n;++i){
    scanf("%s%d%d %c %c%d\n",&a[i].name,&a[i].qimo,&a[i].banji,&a[i].ganbu,&a[i].xibu,&a[i].lunwen);
    }
    for(int i=1;i<=n;++i){
    if(a[i].qimo>80&&a[i].lunwen>=1)a[i].jj+=8000;
    if(a[i].qimo>85&&a[i].banji>80)a[i].jj+=4000;
    if(a[i].qimo>90)a[i].jj+=2000;
    if(a[i].qimo>85&&a[i].xibu=='Y')a[i].jj+=1000;
    if(a[i].banji>80&&a[i].ganbu=='Y')a[i].jj+=850;
    }
    sort(a+1,a+n+1,comp);
    for(int i=1;i<=n;++i){
    s+=a[i].jj;
    }
    cout<<a[1].name<<endl<<a[1].jj<<endl<<s;
    return 0;
    }

    • @ 2016-03-17 18:33:07

      #include<stdio.h>
      #include<stdlib.h>
      #include<string.h>

      struct P{
      char a[233];
      int b,c;
      char d,e;
      int f;
      int money=0;
      };

      int main(int argc,char ** argv){
      int n;
      P p[233];
      scanf("%d",&n);
      int i,j,k,max=0,tol=0;
      for(i=0;i<n;i++)
      scanf("%s %d %d %c %c %d",p[i].a,&p[i].b,&p[i].c,&p[i].d,&p[i].e,&p[i].f);
      for(i=0;i<n;i++)
      {

      if( p[i].b > 80 && p[i].f > 0 )
      p[i].money+=8000;

      if( p[i].b > 85 && p[i].c > 80 )
      p[i].money+=4000;

      if( p[i].b > 90 )
      p[i].money+=2000;

      if( p[i].b > 85 && p[i].e == 'Y' )
      p[i].money+=1000;

      if( p[i].c > 80 && p[i].d == 'Y' )
      p[i].money+=850;

      }
      for(i=0;i<n;i++)
      {
      tol+=p[i].money;
      if( p[i].money > max )
      {
      max=p[i].money;
      k=i;
      }
      }
      printf("%s\n%d\n%d",p[k].a,p[k].money,tol);
      return 0;
      }

  • 0
    @ 2016-03-13 13:47:18

    #include<iostream>
    #include<algorithm>
    #include<cstdio>
    #include<stdio.h>
    using namespace std;
    bool flag=true;int s;

    struct sdd{
    char name[101];
    int qimo;
    int banji;
    char ganbu;
    char xibu;
    int lunwen;
    int jj;
    }a[101];
    int comp(const sdd&a,const sdd&b){
    return a.jj>b.jj;
    }
    int main(){
    int n;cin>>n;
    for(int i=1;i<=n;++i){
    scanf("%s%d%d %c %c%d\n",&a[i].name,&a[i].qimo,&a[i].banji,&a[i].ganbu,&a[i].xibu,&a[i].lunwen);
    }
    for(int i=1;i<=n;++i){
    if(a[i].qimo>80&&a[i].lunwen>=1)a[i].jj+=8000;
    if(a[i].qimo>85&&a[i].banji>80)a[i].jj+=4000;
    if(a[i].qimo>90)a[i].jj+=2000;
    if(a[i].qimo>85&&a[i].xibu=='Y')a[i].jj+=1000;
    if(a[i].banji>80&&a[i].ganbu=='Y')a[i].jj+=850;
    }
    sort(a+1,a+n+1,comp);
    for(int i=1;i<=n;++i){
    s+=a[i].jj;
    }
    cout<<a[1].name<<endl<<a[1].jj<<endl<<s;

    return 0;
    }
    才90分啊 告诉我还有一个答案出错在哪里!!!!!!!!!!!

信息

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