//水仙数
#include<stdio.h>
int main()
{
int a, b, c, x;
for (x = 100; x < 1000; x++)
{
a = x / 100;
b = x / 10 - 10 * a;
c = x % 10;
if (x == a * a * a + b * b * b + c * c * c)
printf(" % 4d", x);
}
printf("\n");
return 0;
}
//例六
#include<stdio.h>
int main()
{
double e=1.0,u=1.0;
int n=1,a=1,m;
while(u>1e-7)
{
a=1;
for(m=1;m<n+1;m++)
{
a=a*m;
}
u=1.0/a;
e=e+u;
n++;
}
printf("%f",e);
return 0;
}