Poj Solution 1517

http://poj.org/problem?id=1517

//* @author: 82638882@163.com
public class Main
{
 public static void main(String[] args)    {

    int i, n, j;
    double e = 0;
 
    System.out.printf("n en- -----------n");
    for (n = 0; n <= 9; ++n)
    {
        i = 1;
        for (j = 1; j <= n; ++j)
            i *= j;
        e += 1.0 / i;
        System.out.printf("%d %10.9fn", n, e);
    }

  }
}
											
This entry was posted in poj. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *