update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
|
|
@ -1,12 +1,11 @@
|
|||
public class Floyd {
|
||||
public static void main(String[] args){
|
||||
System.out.println("5 rows:");
|
||||
printTriangle(5);
|
||||
System.out.println("14 rows:");
|
||||
printTriangle(14);
|
||||
}
|
||||
|
||||
private static void printTriangle(int n){
|
||||
System.out.println(n + " rows:");
|
||||
for(int rowNum = 1, printMe = 1, numsPrinted = 0;
|
||||
rowNum <= n; printMe++){
|
||||
int cols = (int)Math.ceil(Math.log10(n*(n-1)/2 + numsPrinted + 2));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue