Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Advanced_Loops - created by borkins on 2017-04-09.
- */
- import java.util.Scanner;
- public class _14_NumberTable
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- for (int i = 1, j; i <= n; i++)
- {
- for (j = i; j < n; j++) {
- System.out.printf("%d ", j);
- }
- for (int k = 1; k < i; k++, j--) {
- System.out.printf("%d ", j);
- }
- System.out.println(j);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment