508 条题解

  • 0
    @ 2009-03-30 18:26:25

    帮忙看看!!!!!

    帮忙看看!!!!!

    帮忙看看!!!!!

    帮忙看看!!!!!

    帮忙看看!!!!!

    帮忙看看!!!!!

    帮忙看看!!!!!

    编译通过...

    ├ 测试数据 01:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 02:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 03:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 04:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 05:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 06:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 07:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 08:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 09:运行时错误...| 错误号: 106 | 无效数字格式

    ├ 测试数据 10:运行时错误...| 错误号: 106 | 无效数字格式

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:0 有效耗时:0ms

    var name:array[1..100] of string;

    money:array[1..100] of longint;

    i,j,k,l,n,p,b,z:integer;

    g,x:char;

    s:string;

    begin

    readln(n); k:=0;

    for i:=1 to n do

    begin

    readln(name[i],p,b,g,x,l);

    if (p>80)and(l>1) then money[i]:=money[i]+8000;

    if (p>85)and(b>80) then money[i]:=money[i]+4000;

    if p>90 then money[i]:=money[i]+2000;

    if (p>85)and(x='Y') then money[i]:=money[i]+1000;

    if (b>80)and(g='Y') then money[i]:=money[i]+850;

    k:=k+money[i];

    end;

    for i:=1 to n-1 do

    begin

    if money[i]

  • 0
    @ 2009-03-29 16:32:25

    program p1001;

    var

    name:array[1..100]of string;

    s,a,b,e:array[1..100]of longint;

    c,d:array[1..100]of char;

    n,i,res,k:longint;

    ch,ch1,ch2:char;

    function jisuan(a,b:longint; c,d:char; e:longint):longint;

    begin

    jisuan:=0;

    if (a>80)and(e>=1) then jisuan:=jisuan+8000;

    if (a>85)and(b>80) then jisuan:=jisuan+4000;

    if a>90 then jisuan:=jisuan+2000;

    if (a>85)and(d='Y') then jisuan:=jisuan+1000;

    if (b>80)and(c='Y') then jisuan:=jisuan+850;

    end;

    procedure init;

    begin

    readln(n);

    res:=0;

    end;

    procedure doit;

    begin

    for i:=1 to n do

    begin

    read(ch);

    name[i]:=ch;

    read(ch);

    while ch' ' do

    begin

    name[i]:=name[i]+ch;

    read(ch);

    end;

    read(a[i],b[i],ch1,c[i],ch2,d[i],e[i]);

    s[i]:=jisuan(a[i],b[i],c[i],d[i],e[i]);

    res:=res+s[i];

    end;

    k:=1;

    for i:=1 to n do

    if s[i]>s[k] then k:=i;

    end;

    procedure outit;

    begin

    writeln(name[k]);

    writeln(s[k]);

    writeln(res);

    end;

    begin

    init;

    doit;

    outit;

    end.

    细节题...很容易浪费时间!!

    宣传BLOG:http://hi.baidu.com/x50946702

  • 0
    @ 2009-03-28 10:32:33

    #include "stdio.h"

    #include "malloc.h"

    typedef struct

    { char name[20];

    int score[2];

    char gb;

    char xb;

    int lw;

    }DATA;

    int main()

    {

    int * K;

    int N;

    DATA * M;

    int i,flag=0;

    int sum=0,max=0;

    scanf("%d",&N);

    M=(DATA*)malloc(sizeof(DATA)*N);

    K=(int*)malloc(sizeof(int)*N);

    for(i=0;i80))

    K[i]+=4000;

    }

    for(i=0 ; i < N ; i++)//成绩优秀奖

    {

    if(M[i].score[0] >90)

    K[i]+=2000;

    }

    for(i=0 ; i < N ; i++) //西部奖学金

    {

    if(M[i].score[0] >85 && M[i].xb =='Y')

    K[i]+= 1000;

    }

    for(i = 0; i < N; i++) //班级贡献奖

    {

    if(M[i].score[1] >80 && M[i].gb == 'Y')

    K[i]+= 850;

    }

    max=K[0];

    for(i=1 ;i

  • 0
    @ 2009-03-28 07:05:37

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    var

    n,i,j,ok,max,mx,jj:longint;

    st:string;

    name:array[1..100] of string;

    ganbu,xibu,lunwen:array[1..100] of boolean;

    a,b,money:array[1..100] of integer;

    begin

    fillchar(ganbu,sizeof(ganbu),false);

    fillchar(xibu,sizeof(xibu),false);

    fillchar(lunwen,sizeof(lunwen),false);

    fillchar(money,sizeof(money),0);

    fillchar(a,sizeof(a),0);

    fillchar(b,sizeof(b),0);

    max:=-10000; st:='';

    readln(n);

    for i:=1 to n do

    begin

    readln(st);

    j:=pos(' ',st);

    name[i]:=copy(st,1,j-1);

    st:=copy(st,j+1,50);

    j:=pos(' ',st);

    val(copy(st,1,j-1),a[i]);

    st:=copy(st,j+1,50);

    j:=pos(' ',st);

    val(copy(st,1,j-1),b[i]);

    st:=copy(st,j+1,50);

    if st[1]='Y' then ganbu[i]:=true;

    if st[3]='Y' then xibu[i]:=true;

    val(st[5],ok); if ok>0 then lunwen[i]:=true;

    if (a[i]>80)and(lunwen[i]) then money[i]:=money[i]+8000;

    if (a[i]>85)and(b[i]>80) then money[i]:=money[i]+4000;

    if (a[i]>90) then money[i]:=money[i]+2000;

    if (a[i]>85)and(xibu[i]) then money[i]:=money[i]+1000;

    if (b[i]>80)and(ganbu[i]) then money[i]:=money[i]+850;

    mx:=mx+money[i];

    if money[i]>max then

    begin

    jj:=i;

    max:=money[i];

    end;

    end;

    writeln(name[jj]);

    writeln(max);

    writeln(mx);

    end.

  • 0
    @ 2009-03-25 09:19:59

    #include

    #include

    using namespace std;

    #define N 100

    #define M 20

    int bij(int);

    int a[N],b[N],c[N],m[N],n,big=0,z=0;

    char name[N][M],bg[N],xb[N],first[N][M];

    int main()

    {

    cin>>n;

    for(int j=0;j>name[j]>>a[j]>>b[j]>>bg[j]>>xb[j]>>c[j];

    for(int i=0;i80&&c[i]>=1)

    m[i]+=8000;

    if(a[i]>85&&b[i]>80)

    m[i]+=4000;

    if(a[i]>90)

    m[i]+=2000;

    if(a[i]>85&&xb[i]=='Y')

    m[i]+=1000;

    if(b[i]>80&&bg[i]=='Y')

    m[i]+=850;

    z+=m[i];

    if(big

  • 0
    @ 2009-03-20 18:46:43

    program p16;

    var a,b:string;

      e,f,i,j:longint;

      d:char;

    function js(var a2:string):longint;

    var cost,b2,b3,b4,b5,b6,b7,b8:longint; {qi mo pingjun chengji:b4}

      c1,c2,c3:char; {c1:gb    c2:west}

      a3:string;      {banji ping yi chengji:b5   b6:lun wen shu}

    begin

    cost:=0;

    b8:=0;

    b2:=1;

    repeat

      b2:=b2+1;

    until ord(a2[b2])=32;

    b2:=b2+1;

    b3:=b2;

    while (ord(a2[b3])32) do b3:=b3+1;

    a3 := copy(a2, b2, b3-b2);

    val(a3,b4,b8);

    b3 := b3+1;

    b2:=b3;

    while (ord(a2[b3])32) do b3 := b3 +1;

    a3 := copy(a2,b2,b3-b2);

    val(a3,b5,b8);

    b3:=b3+1;

    c1:=a2[b3];

    c2:=a2[b3+2];

    b3:=b3+4;

    b2:=b3;

    if (ord(a2[b3+1])=48) then begin

      a3 := copy(a2,b3,2);

      val(a3,b6,b8);

    end

    else begin

      a3 := copy(a2,b3,1);

      val(a3,b6,b8);

    end;

    if (b5>80)and(c1='Y') then cost := cost+850;

    if (b4>85)and(c2='Y') then cost := cost+1000;

    if (b4>90) then cost := cost+2000;

    if (b4>85)and(b5>80) then cost := cost+4000;

    if (b4>80)and(b6>=1) then cost := cost+8000;

    js := cost;

    end;

    begin

    readln(e);

    readln(a);

    f:=f+js(a);

    for j := 2 to e do begin

      readln(b);

      f:=f+js(b);

      if js(b)>js(a) then a := b;

    end;

    j := 1;

    while ord(a[j])32 do begin

      write(a[j]);

      j:=j+1;

    end;

    writeln;

    writeln(js(a));

    write(f);

    end.

  • 0
    @ 2009-03-15 18:27:07

    都什么破题解呀!

    (.) (.)

    ---|---|---|---|--0oo0(_)0oo0--

    |

    全是错的 |

    0oo0 0oo0 |

    | | | | |

    | | | | |

    ---|---|---|---|--(__)---|-(__)--|

  • 0
    @ 2009-03-14 12:02:10

    #include

    #include

    int calculate(char *a)

    {

    int result=0, score,pyscore,wenshu;

    char c[2];

    sscanf(a,"%*s %d %d %c %c %d",&score,&pyscore,&c[0],&c[1],&wenshu);

    if(score>80 && wenshu>=1)

    result+=8000;

    if(score>85 && pyscore>80)

    result+=4000;

    if(score>90)

    result+=2000;

    if(c[1]=='Y' && score > 85)

    result+=1000;

    if(c[0]=='Y' && pyscore > 80)

    result+=850;

    return result;

    }

    int main()

    {

    int zuigao=0,result[100],total=0,i,j;

    char s[50]={0},name[50],c;

    scanf("%d",&i);

    scanf("%c",&c);

    for(j=0;j zuigao)

    {

    memset(name,0,sizeof(name));

    sscanf(s,"%s %*d %*d %*c %*c %*d",name);

    zuigao = result[j];

    }

    memset(s,0,sizeof(s));

    }

    printf("%s\n%d\n%d\n",name,zuigao,total);

    return 0;

    }

  • 0
    @ 2009-03-13 22:21:32

    program p16;

    var a,b:string;

      e,f,i,j:longint;

      d:char;

    function js(var a2:string):longint;

    var cost,b2,b3,b4,b5,b6,b7,b8:longint; {qi mo pingjun chengji:b4}

      c1,c2,c3:char; {c1:gb    c2:west}

      a3:string;      {banji ping yi chengji:b5   b6:lun wen shu}

    begin

    cost:=0;

    b8:=0;

    b2:=1;

    repeat

      b2:=b2+1;

    until ord(a2[b2])=32;

    b2:=b2+1;

    b3:=b2;

    while (ord(a2[b3])32) do b3:=b3+1;

    a3 := copy(a2, b2, b3-b2);

    val(a3,b4,b8);

    b3 := b3+1;

    b2:=b3;

    while (ord(a2[b3])32) do b3 := b3 +1;

    a3 := copy(a2,b2,b3-b2);

    val(a3,b5,b8);

    b3:=b3+1;

    c1:=a2[b3];

    c2:=a2[b3+2];

    b3:=b3+4;

    b2:=b3;

    if (ord(a2[b3+1])=48) then begin

      a3 := copy(a2,b3,2);

      val(a3,b6,b8);

    end

    else begin

      a3 := copy(a2,b3,1);

      val(a3,b6,b8);

    end;

    if (b5>80)and(c1='Y') then cost := cost+850;

    if (b4>85)and(c2='Y') then cost := cost+1000;

    if (b4>90) then cost := cost+2000;

    if (b4>85)and(b5>80) then cost := cost+4000;

    if (b4>80)and(b6>=1) then cost := cost+8000;

    js := cost;

    end;

    begin

    readln(e);

    readln(a);

    f:=f+js(a);

    for j := 2 to e do begin

      readln(b);

      f:=f+js(b);

      if js(b)>js(a) then a := b;

    end;

    j := 1;

    while ord(a[j])32 do begin

      write(a[j]);

      j:=j+1;

    end;

    writeln;

    writeln(js(a));

    write(f);

    end.

  • 0
    @ 2009-03-10 18:27:42

    Type rec=record

    all,name,w,c:string;

    s,e,p:longint;

    end;

    Var

    n,i,j,maxN,money,total:longint;

    cop,maxP:string;

    a:array[1..100] of rec;

    Begin

    maxN:=0;

    total:=0;

    j:=0;

    readln(n);

    For i:=1 to n do begin

    readln(a[i].all);

      while pos(' ',a[i].all)0 do begin

       j:=j+1;

       cop:=copy(a[i].all,1,pos(' ',a[i].all)-1);

       case j of

       1: a[i].name:=cop;

       2: val(cop,a[i].s);

       3: val(cop,a[i].e);

       4: a[i].c:=cop;

       5: a[i].w:=cop;

       end;

       delete(a[i].all,1,pos(' ',a[i].all));

      if pos(' ',a[i].all)=0 then val(a[i].all,a[i].p);

      end;

      j:=0;

    If (a[i].s>80) and (a[i].p>=1) then money:=8000;

    If (a[i].s>85) and (a[i].e>80) then money:=money+4000;

    If (a[i].s>90) then money:=money+2000;

    If (a[i].s>85) and ((a[i].w='Y') or (a[i].w='y')) then money:=money+1000;

    If (a[i].e>80) and ((a[i].c='Y') or (a[i].c='y')) then money:=money+850;

      If (MaxN=0) or (money>MaxN) then begin

      MaxN:=money;

      MaxP:=a[i].name;

      end;

    Total:= Total + money ;

    money:=0;

    End;

    Writeln(Maxp);

    Writeln(Maxn);

    Writeln(total);

    End.

  • 0
    @ 2009-03-02 13:15:34

    readln(n);

    for i:=1 to n do

    begin

    read(ch);

    while

    read(ch);

    end;

    readln(a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);

    end;

    for i:=1 to n do

    begin

    p:=0;

    if (a1[i]>80)and(a5[i]>=1) then inc(p,8000);

    if (a1[i]>85)and(a2[i]>80) then inc(p,4000);

    if (a1[i]>90) then inc(p,2000);

    if (a1[i]>85)and(a4[i]='Y') then inc(p,1000);

    if (a2[i]>80)and(a3[i]='Y') then inc(p,850);

    if p>max then

    begin

    max:=p;

    maxname:=name[i];

    end;

    inc(total,p);

    end;

    writeln(maxname);

    writeln(max);

    writeln(total);

    end.

  • 0
    @ 2009-02-28 23:58:34

    readln(n);

    for i:=1 to n do

    begin

    read(ch);

    while

    read(ch);

    end;

    readln(a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);

    end;

    for i:=1 to n do

    begin

    p:=0;

    if (a1[i]>80)and(a5[i]>=1) then inc(p,8000);

    if (a1[i]>85)and(a2[i]>80) then inc(p,4000);

    if (a1[i]>90) then inc(p,2000);

    if (a1[i]>85)and(a4[i]='Y') then inc(p,1000);

    if (a2[i]>80)and(a3[i]='Y') then inc(p,850);

    if p>max then

    begin

    max:=p;

    maxname:=name[i];

    end;

    inc(total,p);

    end;

    writeln(maxname);

    writeln(max);

    writeln(total);

    end.

  • 0
    @ 2009-02-21 18:23:07

    program scholar;

    var name:array[1..100] of string;

    a1,a2,a5:array[1..100] of longint;

    a3,a4:array[1..100] of char;

    n,i,max,total,p:longint;

    maxname:string;

    ch:char;

    begin assign(input,'scholar.in');reset(input); readln(n);

    for i:=1 to n do begin read(ch);

    while ch' ' do begin name[i]:=name[i]+ch; read(ch); end; readln(a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]); end; close(input); for i:=1 to n do begin p:=0; if (a1[i]>80) and (a5[i]>=1) then inc(p,8000); if (a1[i]>85) and (a2[i]>80) then inc(p,4000); if (a1[i]>90) then inc(p,2000); if (a1[i]>85) and (a4[i]='Y') then inc(p,1000); if (a2[i]>80) and (a3[i]='Y') then inc(p,850); if p>max then begin max:=p; maxname:=name[i]; end; inc(total,p); end; assign(output,'scholar.out');rewrite(output); writeln(maxname); writeln(max); writeln(total); close(output); end.

  • 0
    @ 2009-02-20 11:21:04

    program cbh;

    var name:array[1..101,1..21]of char;

       q,b,l:array[1..101]of integer;

       m:array[1..101]of longint;

       g,w:array[1..101]of boolean;

       c,p,p1,c1,c2:char;

       i,n,most:integer;

       a:array[1..101]of integer;

       sum,max:longint;

    begin

    readln(n);

    for i:=1 to n do

      begin

       m[i]:=0;a[i]:=1;

       read(name);

       while name' ' do

       begin

       a[i]:=a[i]+1;

       read(name)

       end;

       readln(q[i],b[i],c,c1,p,c2,l[i]);

       if c1='Y' then g[i]:=true else g[i]:=false;

       if c2='Y' then w[i]:=true else w[i]:=false;

      end;

    for i:=1 to n do

      begin

       if (q[i]>80)and(l[i]>0) then m[i]:=m[i]+8000;

       if (q[i]>85)and(b[i]>80) then m[i]:=m[i]+4000;

       if q[i]>90 then m[i]:=m[i]+2000;

       if (q[i]>85)and (w[i]=true) then m[i]:=m[i]+1000;

       if (b[i]>80)and (g[i]=true) then m[i]:=m[i]+850;

      end;

    max:=m[1];most:=1;

    for i:=2 to n do

      if m[i]>max then

       begin

       max:=m[i];

       most:=i;

       end;

    sum:=0;

    for i:=1 to n do

      sum:=sum+m[i];

    for i:=1 to a[most]-1 do

      write(name[most,i]);

    writeln;

    writeln(m[most]);

    writeln(sum);

    end.

  • 0
    @ 2009-02-19 19:41:45

    program scholar;

    var name:array[1..100] of string;

      a1,a2,a5:array[1..100] of longint;

      a3,a4:array[1..100] of char;

      n,i,max,total,p:longint;

      maxname:string; ch:char; f:text;

    begin

    assign(f,'scholar.in');reset(f); readln(f,n);

    for i:=1 to n do

      begin

       read(f,ch);

       while ch' ' do begin name[i]:=name[i]+ch; read(f,ch); end;

       readln(f,a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);

      end;

    close(f);

    for i:=1 to n do

      begin

       p:=0;

       if (a1[i]>80) and (a5[i]>=1) then inc(p,8000);

       if (a1[i]>85) and (a2[i]>80) then inc(p,4000);

       if (a1[i]>90) then inc(p,2000);

       if (a1[i]>85) and (a4[i]='Y') then inc(p,1000);

       if (a2[i]>80) and (a3[i]='Y') then inc(p,850);

       if p>max then begin max:=p; maxname:=name[i];end; inc(total,p);

      end;

    assign(f,'scholar.out');rewrite(f); writeln(f,maxname);

    writeln(f,max); writeln(f,total);

    close(f);

    end.

  • 0
    @ 2009-02-15 16:58:18

    program scholar;

    var name:array[1..100] of string;

    a1,a2,a5:array[1..100] of longint;

    a3,a4:array[1..100] of char;

    n,i,max,total,p:longint;

    maxname:string; ch:char; f:text;

    begin

    assign(f,'scholar.in');reset(f); readln(f,n);

    for i:=1 to n do

    begin

    read(f,ch);

    while ch' ' do begin name[i]:=name[i]+ch; read(f,ch); end;

    readln(f,a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);

    end;

    close(f);

    for i:=1 to n do

    begin

    p:=0;

    if (a1[i]>80) and (a5[i]>=1) then inc(p,8000);

    if (a1[i]>85) and (a2[i]>80) then inc(p,4000);

    if (a1[i]>90) then inc(p,2000);

    if (a1[i]>85) and (a4[i]='Y') then inc(p,1000);

    if (a2[i]>80) and (a3[i]='Y') then inc(p,850);

    if p>max then begin max:=p; maxname:=name[i];end; inc(total,p);

    end;

    assign(f,'scholar.out');rewrite(f); writeln(f,maxname);

    writeln(f,max); writeln(f,total);

    close(f);

    end.

  • 0
    @ 2009-02-10 22:04:41

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    program mostm;

    var name:array[1..101,1..21]of char;

    q,b,l:array[1..101]of integer;

    m:array[1..101]of longint;

    g,w:array[1..101]of boolean;

    c,p,p1,c1,c2:char;

    i,n,most:integer;

    a:array[1..101]of integer;

    sum,max:longint;

    begin

    readln(n);

    for i:=1 to n do

    begin

    m[i]:=0;a[i]:=1;

    read(name);

    while name' ' do

    begin

    a[i]:=a[i]+1;

    read(name)

    end;

    readln(q[i],b[i],c,c1,p,c2,l[i]);

    if c1='Y' then g[i]:=true else g[i]:=false;

    if c2='Y' then w[i]:=true else w[i]:=false;

    end;

    for i:=1 to n do

    begin

    if (q[i]>80)and(l[i]>0) then m[i]:=m[i]+8000;

    if (q[i]>85)and(b[i]>80) then m[i]:=m[i]+4000;

    if q[i]>90 then m[i]:=m[i]+2000;

    if (q[i]>85)and (w[i]=true) then m[i]:=m[i]+1000;

    if (b[i]>80)and (g[i]=true) then m[i]:=m[i]+850;

    end;

    max:=m[1];most:=1;

    for i:=2 to n do

    if m[i]>max then

    begin

    max:=m[i];

    most:=i;

    end;

    sum:=0;

    for i:=1 to n do

    sum:=sum+m[i];

    for i:=1 to a[most]-1 do

    write(name[most,i]);

    writeln;

    writeln(m[most]);

    writeln(sum);

    end.

  • 0
    @ 2009-02-08 21:39:24

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    #include "stdio.h"

    struct stu

    {

    char name[20];

    int a;

    int b;

    char c;

    char d;

    int e;

    int f;

    }student[100];

    main()

    {

    int i,j,max,s,n,sum;

    j=0,sum=0;

    scanf("%d",&n);

    for(i=0;i0)

    s=s+8000;

    if(student[i].a>85&&student[i].b>80)

    s=s+4000;

    if(student[i].a>90)

    s=s+2000;

    if(student[i].a>85&&student[i].d=='Y')

    s=s+1000;

    if(student[i].b>80&&student[i].c=='Y')

    s=s+850;

    student[i].f=s;

    sum=sum+s;

    }

    max=student[0].f;

    for(i=1;i

  • 0
    @ 2009-02-07 12:42:18

    program jiangxuejin;

    var a,b:string;

      e,f,i,j:longint;

      d:char;

    function js(var a2:string):longint;

    var cost,b2,b3,b4,b5,b6,b7,b8:longint; {qi mo pingjun chengji:b4}

      c1,c2,c3:char; {c1:gb    c2:west}

      a3:string;      {banji ping yi chengji:b5   b6:lun wen shu}

    begin

    cost:=0;

    b8:=0;

    b2:=1;

    repeat

      b2:=b2+1;

    until ord(a2[b2])=32;

    b2:=b2+1;

    b3:=b2;

    while (ord(a2[b3])32) do b3:=b3+1;

    a3 := copy(a2, b2, b3-b2);

    val(a3,b4,b8);

    b3 := b3+1;

    b2:=b3;

    while (ord(a2[b3])32) do b3 := b3 +1;

    a3 := copy(a2,b2,b3-b2);

    val(a3,b5,b8);

    b3:=b3+1;

    c1:=a2[b3];

    c2:=a2[b3+2];

    b3:=b3+4;

    b2:=b3;

    if (ord(a2[b3+1])=48) then begin

      a3 := copy(a2,b3,2);

      val(a3,b6,b8);

    end

    else begin

      a3 := copy(a2,b3,1);

      val(a3,b6,b8);

    end;

    if (b5>80)and(c1='Y') then cost := cost+850;

    if (b4>85)and(c2='Y') then cost := cost+1000;

    if (b4>90) then cost := cost+2000;

    if (b4>85)and(b5>80) then cost := cost+4000;

    if (b4>80)and(b6>=1) then cost := cost+8000;

    js := cost;

    end;

    begin

    readln(e);

    readln(a);

    f:=f+js(a);

    for j := 2 to e do begin

      readln(b);

      f:=f+js(b);

      if js(b)>js(a) then a := b;

    end;

    j := 1;

    while ord(a[j])32 do begin

      write(a[j]);

      j:=j+1;

    end;

    writeln;

    writeln(js(a));

    write(f);

    end.

  • 0
    @ 2009-02-06 14:33:51

    program ex;

    var

    ch:char;

    i,j,k,sum,n,f,ssum:longint;

    a,b,c:array [1..101] of longint;

    s1:array [1..101] of string;

    ch1,ch2:array [1..101] of char;

    begin

    readln(n);

    for i:=1 to n do

    begin

    read(ch);

    s1[i]:='';

    while ch' ' do

    begin

    s1[i]:=s1[i]+ch;

    read(ch);

    end;

    read(a[i],b[i]);

    repeat

    read(ch);

    until ch=' ';

    repeat

    read(ch1[i]);

    until ch1[i]' ';

    repeat

    read(ch);

    until ch=' ';

    repeat

    read(ch2[i]);

    until ch2[i]' ';

    repeat

    read(ch);

    until ch=' ';

    readln(c[i]);

    end;

    sum:=0;ssum:=0;

    for i:=1 to n do

    begin

    f:=0;

    if (a[i]>80)and(c[i]0) then f:=f+8000;

    if (a[i]>85)and(b[i]>80) then f:=f+4000;

    if (a[i]>90) then f:=f+2000;

    if (a[i]>85)and(ch2[i]='Y') then f:=f+1000;

    if (b[i]>80)and(ch1[i]='Y') then f:=f+850;

    ssum:=ssum+f;

    if f>sum then

    begin

    j:=i;

    sum:=f;

    end;

    end;

    writeln(s1[j]);

    writeln(sum);

    writeln(ssum);

    end.

信息

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