Formatted with Google Java Formatter

This commit is contained in:
github-actions
2020-10-24 10:23:28 +00:00
parent a23bac99e8
commit 5d59a2e828
219 changed files with 13758 additions and 14582 deletions

View File

@ -2,18 +2,17 @@ package Others;
import java.util.Scanner;
class FloydTriangle {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
int r = sc.nextInt(), n = 0;
sc.close();
for (int i = 0; i < r; i++) {
for (int j = 0; j <= i; j++) {
System.out.print(++n + " ");
}
System.out.println();
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
int r = sc.nextInt(), n = 0;
sc.close();
for (int i = 0; i < r; i++) {
for (int j = 0; j <= i; j++) {
System.out.print(++n + " ");
}
System.out.println();
}
}
}