From 054a80ace059202195909526b5345ea902278ce9 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 28 Apr 2016 07:51:53 +0800 Subject: [PATCH] Create 1715.c --- QUSTOJ/1715.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 QUSTOJ/1715.c diff --git a/QUSTOJ/1715.c b/QUSTOJ/1715.c new file mode 100644 index 0000000..b879daa --- /dev/null +++ b/QUSTOJ/1715.c @@ -0,0 +1,37 @@ +#include +#include +#include +/// itoa implement +char* int2str(int num,char* buff,int bina) +{ + char k[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; + if(bina==10) + { + sprintf(buff,"%d",num); + return buff; + } + int cnt=0; + while(num>0) + { + buff[cnt]=k[num%bina]; + num=num/bina; + cnt++; + } + buff[cnt]=0; + for(int i=0;i