You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
563 B
Java

Fibonacci numbers (Right side)
import java.text.*;
public class TestRight {
public static void main(String args[]) {
long f1 = 1;
long f2 = 1;
RightFormat rf = new RightFormat(20);
System.out.println("Test of RightFormat(20) on Fibonacci numbers:");
for(int ix = 0; ix < 32; ix++) {
System.out.println(rf.format(Long.toString(f1)));
System.out.println(rf.format(Long.toString(f2)));
f1 = f1 + f2;
f2 = f2 + f1;
}
}
}