View Code of Problem 86


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int a=scanner.nextInt();
		int n=scanner.nextInt();
		long result=0;
		long temp=a;
		for (int i = 0; i < n; i++) {
			result=result+temp;
			temp=temp*10+a;
		}
		System.out.println(result);
	}
	
}

Double click to view unformatted code.


Back to problem 86