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[] split = scanner.nextLine().split(" ");
        int n1 = Integer.parseInt(split[0]);
        int n2 = Integer.parseInt(split[1]);
        int sum = 0;
        for (int i = 1; i <= n2; i++) {
            String get = "";
            for (int j = 0; j < i; j++) {
                get += n1;
            }
            sum += Integer.valueOf(get);
        }
        System.out.println(sum);
    }
}

Double click to view unformatted code.


Back to problem 86