(String args[])
| 10 | static final int L = 10; |
| 11 | |
| 12 | public static void main(String args[]) { |
| 13 | int n = Integer.parseInt(args[0]); |
| 14 | int j = 0; |
| 15 | |
| 16 | PiDigitSpigot digits = new PiDigitSpigot(); |
| 17 | |
| 18 | while (n > 0){ |
| 19 | if (n >= L){ |
| 20 | for (int i=0; i<L; i++) System.out.print( digits.next() ); |
| 21 | j += L; |
| 22 | } else { |
| 23 | for (int i=0; i<n; i++) System.out.print( digits.next() ); |
| 24 | for (int i=n; i<L; i++) System.out.print(" "); |
| 25 | j += n; |
| 26 | } |
| 27 | System.out.print("\t:"); System.out.println(j); |
| 28 | n -= L; |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 |