Time Limit: 1000MS | Memory Limit: 10000K | |||
Total Submissions: 14675 | Accepted: 8874 | Special Judge |
Description
Input
Output
Sample Input
no input
Sample Output
n e - ----------- 0 1 1 2 2 2.5 3 2.666666667 4 2.708333333 ...
Source
#include <cstdio> #include <cstdlib> int main(void){ int i, power; double e; printf("n e\n- -----------\n0 1\n1 2\n2 2.5\n"); for (i = power = e = 1; i <=9; i++){ power *= i; e += 1.0 / power; if (i >= 3){ printf("%d %.9f\n", i, e); } } return 0; }
#include<stdio.h> int main() { printf("n e\n - -----------\n 0 1\n 1 2\n 2 2.5\n 3 2.666666667\n 4 2.708333333\n 5 2.716666667\n 6 2.718055556\n 7 2.718253968\n 8 2.718278770\n 9 2.718281526\n"); return 0; }