View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86