#include <stdio.h> #include <math.h> double f(double x){ } int main(void) { double Tm,L=5,h,ci; int i,No,m; for(No=1;No<100;No++){ Tm=0; m=No; ci=-L+h; h=2*L/m; Tm=(f(-L)+f(L))/2; for(i=1;i<m;i++){ Tm+=f(ci); ci+=h; } Tm*=h; } return 0; }
Standard input is empty
1 0.000000000139 2 0.000000000139 3 3.333383151175 4 1.403858144935 5 1.772270493802 6 1.803821883677 7 1.758384277114 8 1.776445872197 9 1.771608231330 10 1.772594308126 11 1.772435181852 12 1.772455856461 13 1.772453675799 14 1.772453863355 15 1.772453850170 16 1.772453850930 17 1.772453850895 18 1.772453850897 19 1.772453850898 20 1.772453850898 21 1.772453850898 22 1.772453850899 23 1.772453850899 24 1.772453850899 25 1.772453850900 26 1.772453850900 27 1.772453850900 28 1.772453850900 29 1.772453850900 30 1.772453850901 31 1.772453850901 32 1.772453850901 33 1.772453850901 34 1.772453850901 35 1.772453850901 36 1.772453850901 37 1.772453850901 38 1.772453850901 39 1.772453850901 40 1.772453850901 41 1.772453850902 42 1.772453850902 43 1.772453850902 44 1.772453850902 45 1.772453850902 46 1.772453850902 47 1.772453850902 48 1.772453850902 49 1.772453850902 50 1.772453850902 51 1.772453850902 52 1.772453850902 53 1.772453850902 54 1.772453850902 55 1.772453850902 56 1.772453850902 57 1.772453850902 58 1.772453850902 59 1.772453850902 60 1.772453850902 61 1.772453850902 62 1.772453850902 63 1.772453850902 64 1.772453850902 65 1.772453850902 66 1.772453850902 67 1.772453850902 68 1.772453850902 69 1.772453850902 70 1.772453850902 71 1.772453850902 72 1.772453850902 73 1.772453850902 74 1.772453850902 75 1.772453850902 76 1.772453850902 77 1.772453850902 78 1.772453850902 79 1.772453850902 80 1.772453850902 81 1.772453850902 82 1.772453850902 83 1.772453850902 84 1.772453850902 85 1.772453850902 86 1.772453850902 87 1.772453850902 88 1.772453850902 89 1.772453850903 90 1.772453850903 91 1.772453850903 92 1.772453850903 93 1.772453850903 94 1.772453850903 95 1.772453850903 96 1.772453850903 97 1.772453850903 98 1.772453850903 99 1.772453850903