View Code of Problem 86

#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,n,t,s=0;
	cin>>a>>n;
	t=a;
	s=a;

	for(int i=2;i<=n;i++){
		t=t*10+a;
		s+=t;
//		cout<<t<<" "<<s<<endl;
		}
	
	
	cout<<s<<endl;
	return 0;
} 

Double click to view unformatted code.


Back to problem 86