//这个可以,我在编译器上运行过的。主要把i改成float型
#include<stdio.h>
void main()
{
int n;
float y=0,i=1;
printf("Please Input n=");
scanf("%d",&n);
while(i<=n)
{
y+=1.0/(long)(i*i*i);
i++;
}
printf("%f,%lf",i,y);
getch();
}
#include<stdio.h>
void main()
{
int n;
float y=0,i=1;
printf("Please Input n=");
scanf("%d",&n);
while(i<=n)
{
y+=1.0/(long)(i*i*i);
i++;
}
printf("%f,%lf",i,y);
getch();
}