#include<stdio.h>
void?fnk(int?a,?int?k);
int?main(){
int?n,?k;
printf("input?n?and?k:");
scanf("%d,%d",?&n,&k);
fnk(n,?k);
return?0;
}
void?fnk(int?n,?int?k)?{
int?temp?=?0,?sum?=?0,?i?=?0;
for?(i?=?0;?i?<?n;?i++)?{
temp?=?temp?*?10?+?k;
sum?=?sum?+?temp;
}
printf("result?is?%d",?sum);
}
正确代码如上: