Solution for CCC '17 J2 - Shifty Sum in Java 8


Nov. 6, 2019 2.096276 seconds Java 8
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
                    Scanner in = new Scanner(System.in);
            int n = in.nextInt();
            int k = in.nextInt();
            int culm = 0;
            
            for(int i = 0; i < k + 1; i++){
                culm += n * Math.pow(10, i);
            }
            
            System.out.println(culm);
 
    }
  
    
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.