#include int main() { float sum,t; int n; sum = 0; printf("输入任意数t"); scanf("%d",&t); for(n = 1;n<=t;++n) { sum =sum +1.0/ n; printf("%2d %6.4f\n", n,sum); } getchar(); }