Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PO8_MatrixNumbers2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- String result = "";
- for (int i = 1; i <= n; i++) {
- int j;
- for (j = i; j <=n ; j++) {
- System.out.print(j + " ");
- }
- for (int k = i-1; k >=1; k--) {
- System.out.print(j + " ");
- j++;
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment