题解

150 条题解

  • 0
    @ 2009-07-24 15:25:07

    program dsa;

    var i,l,code:integer;

    s,s1:ansistring;

    begin

    readln(s);

    l:=length(s);

    s1:=copy(s,l-1,2);

    val(s1,i,code);

    if i mod 4=0 then writeln('0')

    else if (i-3) mod 4=0 then writeln('0')

    else writeln('1');

    end.

    鲁智深大吼一声,,,,,,,,好水

  • 0
    @ 2009-07-19 11:49:45

    编译通过...

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

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

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

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

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

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

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

    (n mod 4=3) or (n mod 4=0)---|---|write('0');

    (n mod 4=1) or (n mod 2=0)---|---|write('1');

    由 n-(n+1)-(n+2)+n+3=0---|--mod 4=0--0

    1+2-3=0---|---|--mod 4=3---|0

  • 0
    @ 2009-07-16 11:49:46

    编译通过...

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

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

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

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

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

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

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

    var n,i:longint; st:array[0..3000]of char;

    a:array[0..3000]of integer;

    begin

    while not(eoln) do

    begin

    inc(n);

    read(st[n]);

    end;

    // n:=length(st);

    for i:=1 to n do a[i]:=ord(st[i])-ord('0');

    for i:=1 to n do

    begin

    a:=a+(a[i] mod 4)*10;

    a[i]:=a[i] div 4;

    end;

    a[n+1]:=a[n+1] div 10;

    if (a[n+1]=1) then write(1) else write(0);

    end.

    取MOD.如果等于0或3.就得0.如果等于1或2.就得1

  • 0
    @ 2009-07-14 11:27:34

    char a[10001];

    .

    .

    .

    int x=(a[n-1]-'0')*10+a[n]-'0';

    if (x%4==1||x%4==2) cout

  • 0
    @ 2009-05-07 17:53:33

    楼下的好长啊

    program ldkf;

    var i,j,l:integer;

    n:ansistring;

    begin

    readln(n); l:=length(n);

    n:=copy(n,l-1,2);

    val(n,i,j);

    if i mod 4=0 then writeln('0') else begin

    if (i-3) mod 4=0 then writeln('0') else writeln('1'); end;

    end.

  • 0
    @ 2009-05-06 18:32:44

    program harry;

    var b,c,a:char;

    i,k:longint;

    begin

    read(a);

    read(b);

    if b in ['0'..'9'] then

    begin

    while b in ['0'..'9'] do

    begin

    c:=a;

    a:=b;

    read(b);

    end;

    k:=ord(a)-48+(ord(c)-48)*10

    end

    else k:=ord(a)-48;

    i:=k mod 4;

    if (i=1) or (i=2) then write(1) else write(0);

    end.

  • 0
    @ 2009-04-29 22:34:33

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

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

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

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

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

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

    水水

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

    var

    a:ansistring;

    b:string;

    c:shortint;

    code:integer;

    begin

    readln(a);

    b:=copy(a,length(a)-1,2);

    val(b,c,code);

    if (c mod 4=1) or (c mod 4=2) then writeln('1')

    else writeln('0');

    end.

    编译通过...

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

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

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

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

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

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

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

  • 0
    @ 2009-04-11 14:31:29

    var b,c,a:char;

    i,k:longint;

    begin

    read(a);

    read(b);

    if b in ['0'..'9'] then

    begin

    while b in ['0'..'9'] do

    begin

    c:=a;

    a:=b;

    read(b);

    end;

    k:=ord(a)-48+(ord(c)-48)*10

    end

    else k:=ord(a)-48;

    i:=k mod 4;

    if (i=1) or (i=2) then write(1) else write(0);

    end.

  • 0
    @ 2009-03-24 12:23:44

    var i,j,k,l,m,n,b,v,a:longint;

    s:ansistring;

    ss:string;

    begin

    readln(s);

    l:=length(s);

    ss:=copy(s,l-2,l);

    val(ss,n);

    a:=n mod 4;

    if (a=1) or (a=2) then writeln(1)

    else writeln(0);

    end.

  • 0
    @ 2009-03-18 12:46:59

    it's so easy!

  • 0
    @ 2009-02-21 15:31:41

    注意 1 + 2 - 3 = 0

    和 1 + 2 - 3 - 4 + 5 - 6 + 7 = 0

    就可以了

  • 0
    @ 2009-02-17 21:46:41

    var n:ansistring;s:word;

    begin

    read(n);

    s:=ord(n[length(n)])-48+(ord(n[length(n)-1])-48)*10;

    case (s mod 4) of

    0,3:write(0);

    1,2:write(1);

    end;

    end.

  • 0
    @ 2009-02-08 22:37:40

    编译通过...

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

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

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

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

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

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

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

    #include "stdio.h"

    main()

    { long long s,i;

    scanf("%Ld",&s);

    if(s

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

    编译通过...

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

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

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

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

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

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

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

    #include

    using namespace std;

    int main()

    {

    char str[10000];

    cin>>str;

    int n,a;

    n=strlen(str);

    if(n==1) a=str[0]-48;

    else a=((str[n-1]-48)+(str[n-2]-48)*10);

    if(a%4==1||a%4==2) cout

  • 0
    @ 2009-02-02 19:32:27

    谢谢各位的友情赞助,我终于做对了!(^o^)/

  • 0
    @ 2009-01-23 22:31:50

    应该怎么弄呢

  • 0
    @ 2009-01-23 21:46:02

    晕死了,一开始没注意到数据范围,WA了N次还很郁闷...

  • 0
    @ 2008-12-07 13:54:55

    program Le18;

    var n:ansistring;

    a,code:longint;

    begin

    readln(n);

    n:=copy(n,length(n)-1,2);

    val(n,a,code);

    case a mod 4 of

    1,2:writeln('1');

    0,3:writeln('0');

    end;

    end.

  • 0
    @ 2008-12-06 20:24:19

    #include

    int main()

    {

    int i,j,k,sum;

    i=0;

    char a[2],b;

    a[0]=48;b=48;

    while((a[1]=getchar())!='\n'){

    b=a[0];

    a[0]=a[1];

    }

    j=b-48;k=a[0]-48; sum=10*j+k;

    if(sum%4==1||sum%4==2)

    printf("1\n");

    else printf("0\n");

    }

信息

ID
1141
难度
5
分类
高精度 | 其他 点击显示
标签
(无)
递交数
4256
已通过
1415
通过率
33%
被复制
12
上传者