From c5c5cf8da2502dfbb8f2be37d7230fd3272e6fb0 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 28 Apr 2016 08:31:14 +0800 Subject: [PATCH] Create 1722.c --- QUSTOJ/1722.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 QUSTOJ/1722.c diff --git a/QUSTOJ/1722.c b/QUSTOJ/1722.c new file mode 100644 index 0000000..abe5cf4 --- /dev/null +++ b/QUSTOJ/1722.c @@ -0,0 +1,23 @@ +#include +#include +#include +char buff[32]; +int main() +{ + int a,b; + scanf("%d,%d",&a,&b); + int tmp; + int ans=0; + for(int i=1;i<=b;i++) + { + for(int j=1;j<=i;j++) + { + buff[j-1]='0'+a; + } + buff[i]=0; + sscanf(buff,"%d",&tmp); + ans+=tmp; + } + printf("a=%d,b=%d\n%d\n",a,b,ans); + return 0; +}