Problems Submissions
Register Login 質問(Gitter) GitHub

Submit Info #3658

Problem Lang User Status Time Memory
A + B cpp kafuka97 AC 5 ms 0.53 MiB

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

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