View Code of Problem 86

#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
    int a,n;
    scanf("%d %d",&a,&n);
    int sum=0,init=a;
    while(n--){
        sum+=a;
        a=a*10+init;
    }
    printf("%d",sum);
	return 0;
}

Double click to view unformatted code.


Back to problem 86