Problems Submissions
Register Login 質問(Gitter) GitHub

Submit Info #3641

Problem Lang User Status Time Memory
A + B cpp kafuka97 AC 6 ms 0.52 MiB

ケース詳細
Name Status Time Memory
example_00 AC 4 ms 0.50 MiB
example_01 AC 5 ms 0.52 MiB
random_00 AC 5 ms 0.52 MiB
random_01 AC 6 ms 0.50 MiB
random_02 AC 5 ms 0.51 MiB
random_03 AC 4 ms 0.49 MiB
random_04 AC 5 ms 0.46 MiB
random_05 AC 4 ms 0.52 MiB
random_06 AC 6 ms 0.45 MiB
random_07 AC 5 ms 0.50 MiB
random_08 AC 5 ms 0.49 MiB
random_09 AC 3 ms 0.50 MiB

#include <unistd.h> int main(int argc,char **argv){ char inbuf[23]; int inptr=0; char outbuf[11]; int outptr=0; inbuf[read(0,(void *)inbuf,22U)]=(char)0; int a,b; a=0; while(inbuf[inptr]>=48) a=a*10+(int)inbuf[inptr++]-48; ++inptr; b=0; while(inbuf[inptr]>=48) b=b*10+(int)inbuf[inptr++]-48; ++inptr; a+=b; { char outtmpbuf[10]; int outtmpptr=0,outtmpdiv; do{ outtmpdiv=a/10; outtmpbuf[outtmpptr++]=(char)(a-outtmpdiv*10+48); a=outtmpdiv; }while(a); while(outtmpptr--) outbuf[outptr++]=outtmpbuf[outtmpptr]; } outbuf[outptr++]=(char)10; write(1,(void *)outbuf,(unsigned int)outptr); return 0; }