View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86