Created
June 1, 2021 17:25
-
-
Save nalidzhik/40ecaccfc5a026e8934997efa247d6bd to your computer and use it in GitHub Desktop.
Solution of the matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Problem9 { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int n = scanner.nextInt(); | |
if (n > 0 && n < 21) { | |
for (int i = 0; i < n; i++) { | |
for (int j = i + 1; j < n + i + 1; j++) { | |
System.out.print(j + " "); | |
} | |
System.out.println(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment