View Code of Problem 86

import java.util.Scanner;

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

Double click to view unformatted code.


Back to problem 86