View Code of Problem 86

import  java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();  
		int n = sc.nextInt();  
		int sum = 0;
		int flag = a;  
		for (int i = 0; i < n; i++) {  
			sum = sum + a;
			a = a*10 + flag;
		}
		 System.out.println(sum);
	}
}

Double click to view unformatted code.


Back to problem 86