Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class belowAndAboveAverage {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] input = sc.nextLine().split(",");
int[] a = new int[input.length];
for (int i = 0; i < a.length; i++) {
a[i] = Integer.parseInt(input[i]);
}
@nalidzhik
nalidzhik / Problem9.java
Created June 1, 2021 17:25
Solution of the matrix
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 + " ");