Skip to content

Instantly share code, notes, and snippets.

@Daniiarz
Created May 14, 2020 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniiarz/de210242e4108404cc62625a22e8e5a7 to your computer and use it in GitHub Desktop.
Save Daniiarz/de210242e4108404cc62625a22e8e5a7 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class GroupC1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
if (j==i){
System.out.println(j);
}
else {
System.out.print(j+",");
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment