diff --git a/QUSTOJ/1231.cpp b/QUSTOJ/1231.cpp new file mode 100644 index 0000000..4fb267c --- /dev/null +++ b/QUSTOJ/1231.cpp @@ -0,0 +1,42 @@ +#include +#include +#include +char buff[128]; +void deal() +{ + int dec,binary; + scanf("%d %d",&dec,&binary); + int orgdec=dec; + memset(buff,0,128); + int i=0; + while(dec>=binary) + { + buff[i++]='0'+dec%binary; + dec=dec/binary; + } + buff[i]='0'+dec; + int len=strlen(buff); + int slen=len/2; +#ifndef __GNUC__ + printf("%s\n",buff); +#endif + for(i=0;i0;all--) + { + deal(); + } + return 0; +}