printf("\n");
for(m=101;m<=200;m++)
{
k=sqrt(m+1);
for(i=2;i<=k;i++)
if(m%i==0)
{
leap=0;
break;
}
if(leap)
{
printf("%-4d",m);
h++;
if(h%10==0)
printf("\n");
}
leap=1;
}
printf("\nThe total is %d",h);
getch();
}
//水仙花数
#include "stdio.h"
#include "conio.h"
main()
{
int i,j,k,n;
printf("'water flower'number is:");
for(n=100;n<1000;n++)
{
i=n/100;/*分解出百位*/
j=n/10%10;/*分解出十位*/
k=n%10;/*分解出个位*/
if(i*100+j*10+k==i*i*i+j*j*j+k*k*k)
printf("%-5d",n);
}
getch();
}
//5位数判断回文
#include "stdio.h"
#include "conio.h"