Skip to content

Commit 1af3806

Browse files
KylerSmithKylerSmith
KylerSmith
authored and
KylerSmith
committed
Clean up FloydTriangle (ft.java)
1 parent da55838 commit 1af3806

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

.DS_Store

-2 KB
Binary file not shown.

ft.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import java.util.Scanner;
2-
class FloydTriangle
3-
{
4-
public static void main(String[] args)
5-
{
6-
Scanner sc = new Scanner(System.in);
7-
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
8-
int r = sc.nextInt();
9-
int n=0;
10-
for(int i=0; i<r; i++)
11-
{
12-
for(int j=0; j<=i; j++)
13-
{
14-
System.out.print(++n+" ");
2+
3+
4+
class FloydTriangle {
5+
public static void main(String[] args) {
6+
Scanner sc = new Scanner(System.in);
7+
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
8+
int r = sc.nextInt(), n = 0;
9+
10+
for(int i=0; i < r; i++) {
11+
for(int j=0; j <= i; j++) {
12+
System.out.print(++n + " ");
13+
}
14+
System.out.println();
15+
}
16+
}
1517
}
16-
System.out.println();
17-
}
18-
}
19-
}

0 commit comments

Comments
 (0)