标签:void print [] img png static ring ++ ati
//水仙花数
public class sxhs {
public static void main(String args[])
{
int i,g,s,b;
for(i=100;i<1000;i++)
{ b=i/100;
s=i%100/10;
g=i%10;
if( (g*g*g+s*s*s+b*b*b) == (100*b+10*s+g) )
System.out.print(i+"\t");
}
}
}
//运行结果
标签:void print [] img png static ring ++ ati
原文地址:http://www.cnblogs.com/songqinzhe/p/7517592.html