题解

1323 条题解

  • 0
    @ 2012-09-11 20:54:59

    var

    a,b:integer;

    begin

    read(a,b);

    writeln(a+b);

    end.

  • 0
    @ 2012-09-11 20:28:37

    var

    a,b:integer;

    begin

    readln(a,b);

    writeln(a+b);

    end.

  • 0
    @ 2012-09-11 16:51:37

    var

    a,b,c:integer;

    begin

    readln(a,b);

    c:=a+b;

    writeln(c);

    readln;

    end.

  • 0
    @ 2012-08-24 08:29:18

    算法:直接计算

  • 0
    @ 2012-08-15 22:11:14

    var

    opr:array[0..1000000] of char;

    data:array[0..1000000] of longint;

    str1:string;

    l:longint;

    procedure init;

    begin

    readln(str1);

    str1:='(' +str1+')';

    l:=length(str1);

    end;

    function count(s1,s2:longint;ch:char):longint;

    var

    i:longint;

    begin

    case ch of

    '+':count:=s1+s2;

    '-':count:=s1-s2;

    '*':count:=s1*s2;

    '/':count:=s1 div s2;

    '^':begin

    count:=1;

    for i:=1 to s2 do

    count:=count*s1;

    end;

    end;

    end;

    procedure main;

    var

    topopr,topdata,i,j,s1,s2,s:longint;

    ch:char;

    begin

    i:=1;

    topopr:=0;

    topdata:=0;

    while i0)

    then begin

    while (opr[topopr]'(') and (topopr>0) do

    begin

    if s10 then s1:=data[topdata-1];

    if s20 then s2:=data[topdata];

    ch:=opr[topopr];

    opr[topopr]:=' ';

    dec(topopr);

    data[topdata]:=0;

    dec(topdata);

    data[topdata]:=count(s1,s2,ch);

    end;

    end

    else begin

    if (opr[topopr]='(') and (topopr1)

    then begin

    opr[topopr]:=' ';

    dec(topopr);

    inc(i);

    end

    else begin

    writeln(data[topdata]);

    exit;

    end;

    end;

    end;

    '+','-': begin

    if not (opr[topopr]='(')

    then begin

    while not (opr[topopr] ='(') do

    begin

    if s10 then s1:=data[topdata-1];

    if s20 then s2:=data[topdata];

    ch:=opr[topopr];

    opr[topopr]:=' ';

    dec(topopr);

    data[topdata]:=0;

    dec(topdata);

    data[topdata]:=count(s1,s2,ch);

    end;

    inc(topopr);

    opr[topopr]:=str1[i];

    end

    else begin

    inc(topopr);

    opr[topopr]:=str1[i];

    end;

    inc(i);

    end;

    '*','/' :begin

    if not (opr[topopr] in ['(','+','-'])

    then begin

    while not (opr[topopr] in ['(','+','-']) do

    begin

    if s10 then s1:=data[topdata-1];

    if s20 then s2:=data[topdata];

    ch:=opr[topopr];

    data[topdata]:=0;

    opr[topopr]:=' ';

    dec(topdata);

    dec(topopr);

    data[topdata]:=count(s1,s2,ch);

    end;

    inc(topopr);

    opr[topopr]:=str1[i];

    end

    else begin

    inc(topopr);

    opr[topopr]:=str1[i];

    end;

    inc(i);

    end;

    '^':begin

    if opr[topopr]='^'

    then begin

    while opr[topopr]='^' do

    begin

    if s10 then s1:=data[topdata-1];

    if s20 then s2:=data[topdata];

    ch:=opr[topopr];

    data[topdata]:=0;

    opr[topopr]:=' ';

    dec(topdata);

    dec(topopr);

    data[topdata]:=count(s1,s2,ch);

    end;

    inc(topopr);

    opr[topopr]:=str1[i];

    end

    else begin

    inc(topopr);

    opr[topopr]:=str1[i];

    end;

    inc(i);

    end;

    '0'..'9':begin

    j:=i;

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

    inc(j);

    while str1[j] in ['0'..'9'] do

    begin

    s:=s*10+ord(str1[j])-48;

    inc(j);

    end;

    i:=j;

    inc(topdata);

    data[topdata]:=s;

    end;

    end;

    end;

    end;

    begin

    init;

    main;

    end.

  • 0
    @ 2012-08-02 16:34:14

    高端算法自重

    直接读入然后输出a+b即可

    vijos这样就AC了,不过额外提一下,某些坑X的OJ[不点名了]需要long long类型,否则会溢出,某些更坑X的OJ有a-b的题目类型,啊为什么这个坑?看看UvaOJ上某道题吧= =至于坑到需要高精度的……似乎还没见到过。。

  • 0
    @ 2012-07-22 21:22:39

    #include

    #include

    using namespace std;

    int main( )

    {   

        int a,b;

        scanf("%d%d",&a,&b);

        int c;

        c=a^b;

        int d;

        int e;

        d=a&b;

    #define Plus1 \

        d=d

  • 0
    @ 2012-07-20 09:14:33

    为什么用cpp写的就一直no cmpiled  fpc就能ac  为什么?

  • 0
    @ 2012-07-15 09:31:11

    我会说我会用__asm吗(内构汇编)

  • 0
    @ 2012-07-11 15:20:56

    楼下的楼下的楼下真是够华丽丽的……各种颜色各种错误……;

    基础题目,有够基础的……直接加直接输出,pascal什么的都可以直接算表达式输出……

  • 0
    @ 2012-07-10 16:53:40

    program p;

    var

    a,b:int64;

    begin

    read(a,b);

    write(a+b)

    end.

  • 0
    @ 2012-07-10 10:33:37

    program p1000;

    var a,b:integer;

    begin

    readln(a,b);

    writeln(a+b);

    end.

  • 0
    @ 2010-07-27 15:59:21

    编译通过...

  • 0
    @ 2010-07-26 20:15:42

    program p1000;

    var

    a,b:integer;

    begin

    readln(a,b);

    writeln(a+b);

    end.

  • 0
    @ 2010-07-24 19:39:13

    哈哈

  • 0
    @ 2010-07-22 16:14:40

    program ex;

    var x,y:longint;

    begin

    readln(x,y);

    writeln(x+y);

    end.

  • 0
    @ 2010-07-17 12:19:03

    A+B It's So Easy

  • 0
    @ 2010-07-16 17:08:31

    #include

    int main()

    {

    int a,b;

    long sum;

    scanf("%d %d",&a,&b);

    sum=a+b;

    printf("%ld",sum);

    return 0;

    }

  • 0
    @ 2010-07-14 14:51:46

    这题还用题解吗?

  • 0
    @ 2010-07-14 12:07:48

    include

    long a;long ps();

    void pl()

    {exit (0);}

    void pp()

    {printf("%d\n",ps()+ps());}

    long pa()

    {scanf("%d",&a);

    return (a);}

    long ps()

    {return (pa());}

    int main()

    {pp();pl();}

    vijos就是比tyvj好啊!

    这东西tyvj无法编译

信息

ID
1000
难度
9
分类
(无)
标签
(无)
递交数
74446
已通过
28492
通过率
38%
被复制
223