#include <stdio.h>
int main ()
{
int n,i,j,k;
printf("水仙花数:\n");
for(n=100;n<=999;n++)
{
i=(n/100)%10;
j=(n/10)%10;
k=n%10;
if(n==i*i*i+j*j*j+k*k*k)
{
printf("%d\n",i*i*i+j*j*j+k*k*k);
printf("\n");
}
}
return 0;
}
#include <stdio.h>
int main()
{
double i, n, sum;
i = 1.0;
n = 1.0;
sum = 1.0;
while (1.0 / i >= (1e-7))
{
i = n * i;
sum=sum+1/i;
n++;
}
printf("%lf",sum);
return 0;
}