#不知道哪里写错了
#include <stdio.h>
#include <stdlib.h>
main()
{
int a,b;
float c;
a=1;
c=0;
printf("请输入b的值:");
scanf("%d",&b);
while(a<=b)
{
c=1.0/a+c;
a++;
}
printf("求得c为:%d",c);
}
#本题要求编程使用whil输入1+1/2+1/3...+1/b,b由键盘自己输入
#使用codeblocks 16.01版本