mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1722.c
This commit is contained in:
parent
ebbacd0e89
commit
c5c5cf8da2
23
QUSTOJ/1722.c
Normal file
23
QUSTOJ/1722.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user