题解

1309 条题解

  • -1
    @ 2015-09-16 20:14:34

    var a,b:longint;
    begin
    readln(a,b);
    writeln(a+b);
    end.
    PACAL算法!。

  • -1
    @ 2015-09-12 15:20:32

    #include <iostream>
    using namespace std;
    int main()
    {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
    }

  • -1
    @ 2015-08-14 11:35:15

    AC
    #include <cstdio>
    int main()
    {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
    return 0;
    }

  • -1
    @ 2015-07-31 19:24:36

    记录信息
    评测状态 Accepted
    题目 P1000 A+B Problem
    递交时间 2015-07-31 19:23:11
    代码语言 C++
    评测机 VijosEx
    消耗时间 22 ms
    消耗内存 532 KiB
    评测时间 2015-07-31 19:23:15

    评测结果
    编译成功

    测试数据 #0: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #1: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #2: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #3: Accepted, time = 1 ms, mem = 528 KiB, score = 10

    测试数据 #4: Accepted, time = 15 ms, mem = 532 KiB, score = 10

    测试数据 #5: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #6: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #7: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #8: Accepted, time = 6 ms, mem = 524 KiB, score = 10

    测试数据 #9: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    Accepted, time = 22 ms, mem = 532 KiB, score = 100

    代码
    #include<iostream>
    #include<string>
    //定义精度位数常量<255
    using namespace std;
    int strbj(string aa,string bb)
    //字符串比较
    {
    int la=aa.length();
    int lb=bb.length();
    if(la>lb)return 1;
    if(la<lb)return 0;
    if(aa>bb)return 1;
    return 0;
    }
    string gjdqh(string a,string b)
    //高精度加法c++,by pengyao1207
    {

    int t=0;
    int jw=0;
    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=(la<lb?la:lb);
    int ll=(la>lb)?(la-lb):(lb-la);
    for(int i=1;i<=km;i++)
    {

    t=a[ka]+b[kb]-96+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    kb--;
    }
    if(la>lb)
    for(int i=1;i<=ll;i++)
    {
    t=a[ka]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    }
    else
    for(int i=1;i<=ll;i++)
    {
    t=b[kb]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    kb--;
    }
    if(jw==1)c="1"+c;
    return c;
    }
    string gjdqc(string a,string b)
    //高精度减法c++,by pengyao1207
    {

    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=lb;
    int ll=la-lb;
    for(int i=1;i<=km;i++)
    {
    if(a[ka]<b[kb])
    {
    a[ka]=a[ka]+10;
    a[ka-1]--;
    }
    c.insert(0,1,char(a[ka]-b[kb]+48));
    ka--;
    kb--;
    }
    for(int i=1;i<=ll;i++)
    {
    if(a[ka]<48)
    {
    c.insert(0,1,'9');
    a[ka-1]--;
    }
    else c.insert(0,1,a[ka]);
    ka--;
    }
    while((c[0]=='0')&&(c.length()!=1))c.erase(0,1);
    return c;
    }
    string gjdqj(string a,string b)
    //高精度乘法c++,by pengyao1207
    {

    string str="0";
    string fz[10];
    int lb=b.length();
    int kb=lb-1;
    fz[0]="0";
    fz[1]=a;
    fz[2]=gjdqh(fz[1],a);
    fz[3]=gjdqh(fz[2],a);
    fz[4]=gjdqh(fz[3],a);
    fz[5]=gjdqh(fz[4],a);
    fz[6]=gjdqh(fz[5],a);
    fz[7]=gjdqh(fz[6],a);
    fz[8]=gjdqh(fz[7],a);
    fz[9]=gjdqh(fz[8],a);
    int sl;
    for(int i=0;i<=kb;i++)
    {

    string str1="0";
    str1=fz[b[i]-48];
    sl=kb-i;
    //for(int k=1;k<=sl;k++)str1=str1+"0";
    str1.insert(str1.length(),sl,'0');
    str=gjdqh(str1,str);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    string gjdqs(string a,string b)
    //高精度除法c++,by pengyao1207
    {

    int la=a.length();
    int ka=la-1;
    string str="";
    string ys="0";
    int zds;
    string fz[10];
    fz[0]="0";
    fz[1]=b;
    fz[2]=gjdqh(fz[1],b);
    fz[3]=gjdqh(fz[2],b);
    fz[4]=gjdqh(fz[3],b);
    fz[5]=gjdqh(fz[4],b);
    fz[6]=gjdqh(fz[5],b);
    fz[7]=gjdqh(fz[6],b);
    fz[8]=gjdqh(fz[7],b);
    fz[9]=gjdqh(fz[8],b);
    for(int i=0;i<=ka;i++)
    {

    if(ys=="0")ys=a[i];

    else
    {
    ys.insert(ys.length(),1,'0');
    ys=gjdqh(ys,a.substr(i,1));
    }
    zds=9;
    for(int j=1;j<=9;j++)
    {

    if(strbj(fz[j],ys))
    {
    zds=j-1;
    break;
    }
    }
    str.insert(str.length(),1,char(zds+48));
    ys=gjdqc(ys,fz[zds]);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    int main()
    {
    string a,b;
    cin>>a>>b;
    cout<<gjdqh(a,b);
    }
    记录信息
    评测状态 Accepted
    题目 P1000 A+B Problem
    递交时间 2015-07-31 19:23:11
    代码语言 C++
    评测机 VijosEx
    消耗时间 22 ms
    消耗内存 532 KiB
    评测时间 2015-07-31 19:23:15

    评测结果
    编译成功

    测试数据 #0: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #1: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #2: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #3: Accepted, time = 1 ms, mem = 528 KiB, score = 10

    测试数据 #4: Accepted, time = 15 ms, mem = 532 KiB, score = 10

    测试数据 #5: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #6: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #7: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #8: Accepted, time = 6 ms, mem = 524 KiB, score = 10

    测试数据 #9: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    Accepted, time = 22 ms, mem = 532 KiB, score = 100

    代码
    #include<iostream>
    #include<string>
    //定义精度位数常量<255
    using namespace std;
    int strbj(string aa,string bb)
    //字符串比较
    {
    int la=aa.length();
    int lb=bb.length();
    if(la>lb)return 1;
    if(la<lb)return 0;
    if(aa>bb)return 1;
    return 0;
    }
    string gjdqh(string a,string b)
    //高精度加法c++,by pengyao1207
    {

    int t=0;
    int jw=0;
    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=(la<lb?la:lb);
    int ll=(la>lb)?(la-lb):(lb-la);
    for(int i=1;i<=km;i++)
    {

    t=a[ka]+b[kb]-96+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    kb--;
    }
    if(la>lb)
    for(int i=1;i<=ll;i++)
    {
    t=a[ka]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    }
    else
    for(int i=1;i<=ll;i++)
    {
    t=b[kb]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    kb--;
    }
    if(jw==1)c="1"+c;
    return c;
    }
    string gjdqc(string a,string b)
    //高精度减法c++,by pengyao1207
    {

    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=lb;
    int ll=la-lb;
    for(int i=1;i<=km;i++)
    {
    if(a[ka]<b[kb])
    {
    a[ka]=a[ka]+10;
    a[ka-1]--;
    }
    c.insert(0,1,char(a[ka]-b[kb]+48));
    ka--;
    kb--;
    }
    for(int i=1;i<=ll;i++)
    {
    if(a[ka]<48)
    {
    c.insert(0,1,'9');
    a[ka-1]--;
    }
    else c.insert(0,1,a[ka]);
    ka--;
    }
    while((c[0]=='0')&&(c.length()!=1))c.erase(0,1);
    return c;
    }
    string gjdqj(string a,string b)
    //高精度乘法c++,by pengyao1207
    {

    string str="0";
    string fz[10];
    int lb=b.length();
    int kb=lb-1;
    fz[0]="0";
    fz[1]=a;
    fz[2]=gjdqh(fz[1],a);
    fz[3]=gjdqh(fz[2],a);
    fz[4]=gjdqh(fz[3],a);
    fz[5]=gjdqh(fz[4],a);
    fz[6]=gjdqh(fz[5],a);
    fz[7]=gjdqh(fz[6],a);
    fz[8]=gjdqh(fz[7],a);
    fz[9]=gjdqh(fz[8],a);
    int sl;
    for(int i=0;i<=kb;i++)
    {

    string str1="0";
    str1=fz[b[i]-48];
    sl=kb-i;
    //for(int k=1;k<=sl;k++)str1=str1+"0";
    str1.insert(str1.length(),sl,'0');
    str=gjdqh(str1,str);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    string gjdqs(string a,string b)
    //高精度除法c++,by pengyao1207
    {

    int la=a.length();
    int ka=la-1;
    string str="";
    string ys="0";
    int zds;
    string fz[10];
    fz[0]="0";
    fz[1]=b;
    fz[2]=gjdqh(fz[1],b);
    fz[3]=gjdqh(fz[2],b);
    fz[4]=gjdqh(fz[3],b);
    fz[5]=gjdqh(fz[4],b);
    fz[6]=gjdqh(fz[5],b);
    fz[7]=gjdqh(fz[6],b);
    fz[8]=gjdqh(fz[7],b);
    fz[9]=gjdqh(fz[8],b);
    for(int i=0;i<=ka;i++)
    {

    if(ys=="0")ys=a[i];

    else
    {
    ys.insert(ys.length(),1,'0');
    ys=gjdqh(ys,a.substr(i,1));
    }
    zds=9;
    for(int j=1;j<=9;j++)
    {

    if(strbj(fz[j],ys))
    {
    zds=j-1;
    break;
    }
    }
    str.insert(str.length(),1,char(zds+48));
    ys=gjdqc(ys,fz[zds]);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    int main()
    {
    string a,b;
    cin>>a>>b;
    cout<<gjdqh(a,b);
    }
    记录信息
    评测状态 Accepted
    题目 P1000 A+B Problem
    递交时间 2015-07-31 19:23:11
    代码语言 C++
    评测机 VijosEx
    消耗时间 22 ms
    消耗内存 532 KiB
    评测时间 2015-07-31 19:23:15

    评测结果
    编译成功

    测试数据 #0: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #1: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #2: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #3: Accepted, time = 1 ms, mem = 528 KiB, score = 10

    测试数据 #4: Accepted, time = 15 ms, mem = 532 KiB, score = 10

    测试数据 #5: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #6: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #7: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    测试数据 #8: Accepted, time = 6 ms, mem = 524 KiB, score = 10

    测试数据 #9: Accepted, time = 0 ms, mem = 524 KiB, score = 10

    Accepted, time = 22 ms, mem = 532 KiB, score = 100

    代码
    #include<iostream>
    #include<string>
    //定义精度位数常量<255
    using namespace std;
    int strbj(string aa,string bb)
    //字符串比较
    {
    int la=aa.length();
    int lb=bb.length();
    if(la>lb)return 1;
    if(la<lb)return 0;
    if(aa>bb)return 1;
    return 0;
    }
    string gjdqh(string a,string b)
    //高精度加法c++,by pengyao1207
    {

    int t=0;
    int jw=0;
    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=(la<lb?la:lb);
    int ll=(la>lb)?(la-lb):(lb-la);
    for(int i=1;i<=km;i++)
    {

    t=a[ka]+b[kb]-96+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    kb--;
    }
    if(la>lb)
    for(int i=1;i<=ll;i++)
    {
    t=a[ka]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    ka--;
    }
    else
    for(int i=1;i<=ll;i++)
    {
    t=b[kb]-48+jw;
    c.insert(0,1,char((t%10)+48));
    jw=((t>9)?1:0);
    kb--;
    }
    if(jw==1)c="1"+c;
    return c;
    }
    string gjdqc(string a,string b)
    //高精度减法c++,by pengyao1207
    {

    int la=a.length();
    int lb=b.length();
    string c="";
    int ka=la-1;
    int kb=lb-1;
    int km=lb;
    int ll=la-lb;
    for(int i=1;i<=km;i++)
    {
    if(a[ka]<b[kb])
    {
    a[ka]=a[ka]+10;
    a[ka-1]--;
    }
    c.insert(0,1,char(a[ka]-b[kb]+48));
    ka--;
    kb--;
    }
    for(int i=1;i<=ll;i++)
    {
    if(a[ka]<48)
    {
    c.insert(0,1,'9');
    a[ka-1]--;
    }
    else c.insert(0,1,a[ka]);
    ka--;
    }
    while((c[0]=='0')&&(c.length()!=1))c.erase(0,1);
    return c;
    }
    string gjdqj(string a,string b)
    //高精度乘法c++,by pengyao1207
    {

    string str="0";
    string fz[10];
    int lb=b.length();
    int kb=lb-1;
    fz[0]="0";
    fz[1]=a;
    fz[2]=gjdqh(fz[1],a);
    fz[3]=gjdqh(fz[2],a);
    fz[4]=gjdqh(fz[3],a);
    fz[5]=gjdqh(fz[4],a);
    fz[6]=gjdqh(fz[5],a);
    fz[7]=gjdqh(fz[6],a);
    fz[8]=gjdqh(fz[7],a);
    fz[9]=gjdqh(fz[8],a);
    int sl;
    for(int i=0;i<=kb;i++)
    {

    string str1="0";
    str1=fz[b[i]-48];
    sl=kb-i;
    //for(int k=1;k<=sl;k++)str1=str1+"0";
    str1.insert(str1.length(),sl,'0');
    str=gjdqh(str1,str);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    string gjdqs(string a,string b)
    //高精度除法c++,by pengyao1207
    {

    int la=a.length();
    int ka=la-1;
    string str="";
    string ys="0";
    int zds;
    string fz[10];
    fz[0]="0";
    fz[1]=b;
    fz[2]=gjdqh(fz[1],b);
    fz[3]=gjdqh(fz[2],b);
    fz[4]=gjdqh(fz[3],b);
    fz[5]=gjdqh(fz[4],b);
    fz[6]=gjdqh(fz[5],b);
    fz[7]=gjdqh(fz[6],b);
    fz[8]=gjdqh(fz[7],b);
    fz[9]=gjdqh(fz[8],b);
    for(int i=0;i<=ka;i++)
    {

    if(ys=="0")ys=a[i];

    else
    {
    ys.insert(ys.length(),1,'0');
    ys=gjdqh(ys,a.substr(i,1));
    }
    zds=9;
    for(int j=1;j<=9;j++)
    {

    if(strbj(fz[j],ys))
    {
    zds=j-1;
    break;
    }
    }
    str.insert(str.length(),1,char(zds+48));
    ys=gjdqc(ys,fz[zds]);
    }
    while((str[0]=='0')&&(str.length()!=1))str.erase(0,1);
    return str;
    }
    int main()
    {
    string a,b;
    cin>>a>>b;
    cout<<gjdqh(a,b);
    }

  • -1
    @ 2015-07-25 21:39:08

    #include <iostream>
    using namespace std;
    int main()
    {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
    }

  • -1
    @ 2015-07-25 21:35:00

    #include <iostream>
    using namespace std;
    int main()
    {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
    }

  • -1
    @ 2015-07-22 16:55:02

    #define POI <cstdio>

    #define Poi 0

    #define poooi main()

    #define poi int

    #define poipoi ,

    #define poipoipoi ;

    #define poipoipoipoi

    #define poipoipoipoipoi scanf

    #define poipoipoipoipoipoi printf

    #define poipoipoipoipoipoipoi return

    #define poipoipoipoipoipoipoipoi "%d%d"

    #define poipoipoipoipoipoipoipoipoi "%d"

    #define poipoipoipoipoipoipoipoipoipoi (

    #define poipoipoipoipoipoipoipoipoipoipoi )

    #define poipoipoipoipoipoipoipoipoipoipoipoi +

    #define poipoipoipoipoipoipoipoipoipoipoipoipoi &

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoi a

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi b

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi {

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi }

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi using

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi namespace

    #define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi std

    #include POI

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoi

    poi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoi

    poi

    poooi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoi

    poipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoi

    poipoipoi

    poipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoi

    poipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

    poipoipoipoipoipoipoipoipoipoipoi

    poipoipoi

    poipoipoipoipoipoipoi

    Poi

    poipoipoi

    poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi

  • -1
    @ 2015-07-14 11:18:21

    #include<cstdio>
    int pre[2000],sum[2000],next[2000],mis[200];
    int x,n,t,m,y,k,a,b;
    bool pd[200];
    bool aa,bb;
    int ax,ay,az,bx,by,bz,cx,cy,cz;
    int max(int a,int b,int c=-100)
    {
    if(a>=b && a>=c) return a;
    if(b>=a && b>=c) return b;
    return c;
    }
    void swap()
    {
    if(x>y) {int p=x;x=y;y=p;}
    }
    void build(int i,int l,int r)
    {
    if (l==r) {int p;scanf("%d",&p);sum[i]=pre[i]=mis[i]=next[i]=p;return;}
    int mid=l+r>>1;
    build(i<<1,l,mid);
    build(i<<1|1,mid+1,r);
    mis[i]=max(mis[i<<1],mis[i<<1|1],next[i<<1]+pre[i<<1|1]);
    pre[i]=max(pre[i<<1],sum[i<<1]+pre[i<<1|1]);
    next[i]=max(next[i<<1|1],next[i<<1]+sum[i<<1|1]);
    sum[i]=sum[i<<1]+sum[i<<1|1];
    }
    void change(int i,int x,int z,int l,int r)
    {
    if(l==r){pre[i]=mis[i]=next[i]=sum[i]=z;return;}
    int mid=l+r>>1;
    if(x<=mid) change(i<<1,x,z,l,mid);
    else change(i<<1|1,x,z,mid+1,r);
    mis[i]=max(mis[i<<1],mis[i<<1|1],next[i<<1]+pre[i<<1|1]);
    pre[i]=max(pre[i<<1],sum[i<<1]+pre[i<<1|1]);
    next[i]=max(next[i<<1|1],next[i<<1]+sum[i<<1|1]);
    sum[i]=sum[i<<1]+sum[i<<1|1];
    }
    void query(int i,int x,int y,int l,int r)
    {
    if(x<=l && r<=y)
    {
    if(!t) {ax=mis[i];bz=next[i];}
    else {bx=mis[i];by=pre[i];bz=next[i];}
    cx=max(ax,bx,az+by);
    cz=max(bz,sum[i]+az);
    cx=max(cx,cz);
    ax=cx;
    az=cz;
    t++;
    return;
    }
    int mid=l+r>>1;
    if(x<=mid) query(i<<1,x,y,l,mid);
    if(y>mid) query(i<<1|1,x,y,mid+1,r);
    }
    int main()
    {
    build(1,1,2);
    query(1,1,2,1,2);
    printf("%d",mis[1]);
    }

    • @ 2015-07-14 14:36:48

      cao

  • -1
    @ 2015-06-14 15:31:03

    #include <iostream>
    using namespace std;
    int main()
    {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
    }

  • -1
    @ 2015-05-18 13:14:31

    难度为9也,最难的题目了,我这个蒟蒻做不出来呢。。
    大神们求教:
    #include<iostream>
    using namespace std;
    int main()
    {
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0
    }
    为什么没有错?

  • -1
    @ 2015-05-08 17:33:46

    #include <stdio.h>
    int main()
    {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
    return 0;
    }

  • -1
    @ 2014-12-19 16:36:15

    #include<iostream>
    using namespace std;

    int main()
    {
    int a,b,c;
    cin>>a>>b;
    c=a+b;
    cout<<c<<endl;
    return 0;
    }

  • -1
    @ 2014-12-06 13:28:10

    ###略有难度。。。啊哈哈哈哈哈###
    ##高精度##
    测试数据 #0: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 296 KiB, score = 10
    测试数据 #4: Accepted, time = 0 ms, mem = 296 KiB, score = 10
    测试数据 #5: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    测试数据 #6: Accepted, time = 0 ms, mem = 296 KiB, score = 10
    测试数据 #7: Accepted, time = 0 ms, mem = 296 KiB, score = 10
    测试数据 #8: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    测试数据 #9: Accepted, time = 0 ms, mem = 300 KiB, score = 10
    Accepted, time = 0 ms, mem = 300 KiB, score = 100

    #/*代码*/#
    #include <iostream>
    #include <algorithm>
    #include <cstdio>
    #include <cstdlib>
    #include <cstring>
    #include <cmath>
    #include <queue>
    using namespace std;

    int a[1002],b[1002],c[2005],L,L1,L2;
    char str1[1002],str2[1002];
    int main(){
    cin>>str1>>str2;
    L1=strlen(str1);
    L2=strlen(str2);
    L=(max(L1,L2));
    for (int i=0;i<L1;i++) a[i]=str1[L1-i-1]-'0';
    for (int i=0;i<L2;i++) b[i]=str2[L2-i-1]-'0';
    for (int i=0;i<L;i++) c[i]=a[i]+b[i];
    for (int i=0;i<L;i++)
    if (c[i]>=10) c[i+1]++,c[i]-=10;
    if (c[L]!=0)
    for (int i=L;i>=0;i--) cout<<c[i];
    else for (int i=L-1;i>=0;i--)
    cout<<c[i];
    return 0;
    }

  • -1
    @ 2014-11-04 21:15:57

    ###Plus A+B
    #include <stdio.h>
    int main()
    {
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d",a+b);
    return 0;
    }

  • -1
    @ 2014-11-03 18:50:28

    program Plus;
    var a,b:longint;
    begin
    readln(a,b);
    writeln(a+b);
    end.

  • -1
    @ 2014-10-30 18:21:36

    var
    a,b:integer;
    begin
    rea(a,b);
    writeln(a+b);
    end.

  • -1
    @ 2014-10-29 16:28:12

    123 500

  • -1
    @ 2014-10-29 13:11:47

    var x,y,z:integer;
    begin
    readln(x,y);
    z:=x+y;
    write(z);
    end.

  • -1
    @ 2014-10-28 17:42:30

    var a,b,c:longint;
    begin
    read(a,b);
    c:=a+b;
    writeln(c);
    end.

  • -1
    @ 2014-10-27 20:48:43

    #include<iostream>
    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
    }

信息

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