题解:直接模拟
#include <cstdio> int main(){ puts("n e");puts("- -----------");puts("0 1"); double ans=1.0,f=1.0; for(int i=1;i<=9;i++){ if(i==1)printf("%d %.0lf ",i,(ans+=(f/=(double)i))); else if(i==2)printf("%d %.1lf ",i,(ans+=(f/=(double)i))); else printf("%d %.9lf ",i,(ans+=(f/=(double)i))); }return 0; }