View Code of Problem 86

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int a,n,r=0,sum=0,k=0;
    cin>>a>>n;
    for(int i=0;i<n;i++){
        r=k*10+a;
        k=r;
        sum+=r;
    }
    cout<<sum<<endl;
    return 0;
}

Double click to view unformatted code.


Back to problem 86