#include<stdio.h> #include<math.h> int main() { double a, n,i,j,sum=0,w; scanf("%lf%lf", &a, &n); w = a; for(i=1;i<=n;i++) for (j = 1; j <= i; j++) { a = w * pow(10, j - 1);//3x10^0 sum = sum + a; //3x10^1+3x10^0 } //3x10^2+3x10^1+3x10^0 printf("%.0lf", sum); //...... return 0; }