题解

279 条题解

  • 0
    @ 2009-04-22 19:25:12

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    有个细节,有X的输出也有X的输入。

    这点害我WA了几次

  • 0
    @ 2009-04-18 19:55:02

    var

    s:string;

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

    ans:longint;

    c:char;

    procedure init;

    var len,i:integer;

    begin

    readln(s);

    a[1]:=ord(s[1])-48;

    for i:=3 to 5 do

    a:=ord(s[i])-48;

    for i:=7 to 11 do

    a:=ord(s[i])-48;

    a[10]:=ord(s[13])-48;

    { for i:=1 to 10 do

    write(a[i]);}

    end;

    procedure main;

    var i:integer;

    begin

    ans:=0;

    for i:=1 to 9 do

    ans:=ans+a[i]*i;

    { writeln(ans);}

    ans:=ans mod 11;

    c:=chr(ans+48);

    if ans=10 then

    c:='X';

    if c=chr(a[10]+48) then

    writeln('Right')

    else

    begin

    { writeln(ans);}

    s[13]:=c;

    writeln(s);

    end;

    end;

    begin

    init;

    main;

    end.

  • 0
    @ 2009-04-13 18:08:52

    这种水题我都是第1001个过的……

    Flag    Accepted

    题号   P1484

    类型(?)   字符串处理

    通过   1001人

    提交   2295次

    通过率   44%

    难度   1

  • 0
    @ 2009-04-08 13:04:17

    同一个程序:

    第一次交:

    编译通过...

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

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

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

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

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

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

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

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

    ├ 测试数据 09:运行超时|无输出...

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

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

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

    第二次交:

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    ……无语

  • 0
    @ 2009-04-06 11:13:32

    比赛的时候只拿了70分……泪……

    输出时的‘X’有注意却忘了输入里也可能有‘X’的……

    现在会一次AC了……

  • 0
    @ 2009-03-31 19:58:46

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    一次AC,庆祝下(虽然NOIP考试考过了……)

    program ma;

    var

    s:string;

    ch:char;

    i,n,sum:longint;

    begin

    readln(s);

    sum:=0;

    for i:=1 to length(s)-1 do

    begin

    if s[i] in ['0'..'9'] then

    begin

    inc(n);

    sum:=sum+(ord(s[i])-48)*n;

    end;

    end;

    sum:=sum mod 11;

    if sum=10 then

    ch:='X'

    else

    ch:=chr(sum+48);

    if s[length(s)]=ch then

    write('Right')

    else

    begin

    for i:=1 to length(s)-1 do

    write(s[i]);

    write(ch);

    end;

    end.

  • 0
    @ 2009-03-21 21:57:19

    program isbn;

    var s:string;

    i,j,k,l,a:integer;

    begin

    readln(s);

    a:=0;

    k:=0;

    for i:=1 to 11 do

    if (i=2) or (i=6) then a:=i*0+a

    else begin inc(l);a:=(ord(s[i])-48)*l+a; end;

    if (a mod 11=ord(s[13])-48) or ((a mod 11=10) and (s[13]='X')) then write('Right')

    else if (a mod 11ord(s[13])-48) then begin k:=1;s[13]:=char(a mod 11+48); end ;

    if (a mod 11=10) and (s[13]'X') then begin s[13]:='X';k:=1; end;

    if k=1 then for i:=1 to 13 do

    write(s[i]);

    end.

  • 0
    @ 2009-03-18 17:54:46

    var s,s1:string;

    x,t,i,j:integer;

    a:array[1..15] of string;

    begin

    readln (s);

    for i:=1 to 13 do begin

    if copy(s,i,1)'-' then begin j:=j+1;a[j]:=copy(s,i,1);end;

    end;

    t:=0;

    for i:=1 to 9 do begin

    val(a[i],x);

    t:=t+x*i;

    end;

    t:=t mod 11;

    str(t,s1);

    if s1=copy(s,13,1) then write ('Right');

    if (s1copy(s,13,1)) and (s1'10') then write (copy(s,1,12),s1);

    if (s1='10') and (copy(s,13,1)='X') then write ('Right');

    if (s1='10') and (copy(s,13,1)'X') then write (copy(s,1,12),'X');

    end.

  • 0
    @ 2009-03-08 19:10:17

    program ex;

    var

    a,b,c,i:integer;

    s:string;

    x:array[1..13]of integer;

    BEGIN

    read(s);

    a:=length(s);

    for i:= 1 to a do

    x[i]:=(ord(s[i])-48);

    b:=(x[1]*1+x[3]*2+x[4]*3+x[5]*4+x[7]*5+x[8]*6+x[9]*7+x[10]*8+x[11]*9) mod 11;

    if b=x[13]then

    writeln('Right')

    else if ((b=10) and (x[13]=40)) then

      writeln('Right')

      else if b=10 then

       begin

       for i:= 1 to 12 do

       write(chr(x[i]+48));

       writeln('X');

       end

      else if ((b10) and (bx[13])) then

       begin

       for i:= 1 to 12 do

       write(chr(x[i]+48));

       writeln(chr(b+48));

       end;

    END.

  • 0
    @ 2009-02-25 12:34:12

    var a,b:string;

    i,j,m:longint;

    f:char;

    s:array[1..10000]of longint;

    begin

    m:=0;

    j:=1;

    readln(a);

    for i:=1 to 13 do begin

    if a[i]'-'then begin

    s[j]:=ord(a[i])-48;

    j:=j+1;end; end;

    for j:=1 to 9 do

    begin

    m:=m+s[j]*j;

    end;

    m:=m mod 11;

    if m=10 then f:='X'

    else f:=chr(m+48);

    if f=a[13] then begin write('Right') end else begin

    a[13]:=f;

    writeln(a); end;

    end.

  • 0
    @ 2009-02-22 10:35:28

    program ex;

    var

    a,b,c,i:integer;

    s:string;

    x:array[1..13]of integer;

    BEGIN

    read(s);

    a:=length(s);

    for i:= 1 to a do

    x[i]:=(ord(s[i])-48);

    b:=(x[1]*1+x[3]*2+x[4]*3+x[5]*4+x[7]*5+x[8]*6+x[9]*7+x[10]*8+x[11]*9) mod 11;

    if b=x[13]then

    writeln('Right')

    else if ((b=10) and (x[13]=40)) then

    writeln('Right')

    else if b=10 then

    begin

    for i:= 1 to 12 do

    write(chr(x[i]+48));

    writeln('X');

    end

    else if ((b10) and (bx[13])) then

    begin

    for i:= 1 to 12 do

    write(chr(x[i]+48));

    writeln(chr(b+48));

    end;

    END.

  • 0
    @ 2009-02-14 22:53:24

    var

    we:array[1..11] of longint;

    n,ln,h,r,he,k,lon:longint;

    s:string;

    ch:char;

    begin

    he:=0; ln:=0; lon:=0; h:=0;

    readln(s);

    for n:=1 to 11 do

    begin

    if (n2) and (n6) then

    begin

    inc(lon);

    inc(h);

    k:=ord(s[n]); we[lon]:=k-48;

    we[lon]:=we[lon]*h;

    end;

    end;

    if s[13]='X' then begin we[10]:=10; ch:='X'; end else

    val(s[13],we[10]);

    for r:=1 to 9 do

    ln:=we[r]+ln;

    he:=ln mod 11;

    if he=10 then ch:='X' else ch:=chr(he+48);

    if he=we[10] then writeln('Right') else

    begin

    s[13]:=ch;

    writeln(s);

    end;

    end.

  • 0
    @ 2009-02-11 20:05:57

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    一次AC。

  • 0
    @ 2009-02-06 22:52:01

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    刷题玩呢!!!!!

    真是水题,我这样菜都一次AC

  • 0
    @ 2009-02-01 21:50:42

    纪念……此题NOIP时竟然只得80分…………忘记考虑输入X…………哭死

  • 0
    @ 2009-01-26 20:21:38

    看出那个错了吗??

    告诉你吧 第16行的a【12】写成a【13】

    !!!我晕晕晕

  • 0
    @ 2009-01-20 20:29:12

    编译通过...

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

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

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

    ├ 测试数据 04:答案错误...程序输出比正确答案长

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

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

    ├ 测试数据 07:答案错误...程序输出比正确答案长

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

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

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

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

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

    ???????????????????

  • 0
    @ 2009-01-19 16:01:14

    program isbn;

    var

    a,b,c,n,m,p,i,j:integer;

    s:string;

    x,y:array[1..20] of integer;

    begin

    read(s);

    c:=length(s);

    for i:=1 to c do

    x[i]:=ord(s[i])-48;

    a:=x[1]*1+x[3]*2+x[4]*3+x[5]*4+x[7]*5+x[8]*6+x[9]*7+x[10]*8+x[11]*9;

    a:=a mod 11;

    if (x[13]=a) then write('Right')

    else if ((a=10) and (x[13]=40)) then write('Right')

    else if (a=10) then

    begin

    for i:=1 to 12 do

    write(chr(x[i]+48));

    write('X');

    end

    else if (a10) and (ax[13]) then

    begin

    for i:=1 to 12 do

    write(chr(x[i]+48));

    write(chr(a+48));

    end;

    end.

  • 0
    @ 2009-01-14 11:59:53

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    program isbn;

    var

    a,b,c,n,m,p,i,j:integer;

    s:string;

    x,y:array[1..20] of integer;

    begin

    read(s);

    c:=length(s);

    for i:=1 to c do

    x[i]:=ord(s[i])-48;

    a:=x[1]*1+x[3]*2+x[4]*3+x[5]*4+x[7]*5+x[8]*6+x[9]*7+x[10]*8+x[11]*9;

    a:=a mod 11;

    if (x[13]=a) then write('Right')

    else if ((a=10) and (x[13]=40)) then write('Right')

    else if (a=10) then

    begin

    for i:=1 to 12 do

    write(chr(x[i]+48));

    write('X');

    end

    else if (a10) and (ax[13]) then

    begin

    for i:=1 to 12 do

    write(chr(x[i]+48));

    write(chr(a+48));

    end;

    end.

  • 0
    @ 2008-12-26 22:09:09

    编译通过...

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

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

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

    ├ 测试数据 04:答案错误...程序输出比正确答案长

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

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

    ├ 测试数据 07:答案错误...程序输出比正确答案长

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

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

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

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

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

    var i,j,k,l,m,n,s:longint;

    c:array[1..13] of char;

    a:array[1..13] of longint;

    begin

    for i:=1 to 13 do read(c[i]);

    j:=0;

    for i:=1 to 12 do

    if c[i]'-' then begin

    inc(j);

    a[j]:=ord(c[i])-48;

    end;

    m:=ord(c[13])-48;

    s:=0;

    for i:=1 to j do begin

    s:=s+a[i]*i;

    s:=s mod 11;

    end;

    if s=m then writeln('Right')

    else begin

    for i:=1 to 12 do write(c[i]);

    if s=10 then write('X') else

    write(s);

    end;

    end.

    我要疯掉了,为什么????????

信息

ID
1484
难度
5
分类
字符串 点击显示
标签
递交数
14413
已通过
4935
通过率
34%
被复制
32
上传者