|
|
back to boardWrong answer test 1 in Java 1.7 please help me import java.util.Scanner; public class _1506 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n, k, j, i; n = s.nextInt(); k = s.nextInt(); k = (n + k - 1) / k; int[] a = new int[n]; for (i = 0; i < n; i++) { a[i] = s.nextInt(); } for (j = 0; j < k; System.out.println(""), j++) for (i = j; i < n; i += k) { System.out.print(" " + a[i]); } } } |
|
|