输出所有的水仙花数 public class ShuXianHua{ public static void main(String args[]){ int i = 100 , g = 0 , s = 0 , b = 0 ; for(i = 100 ; i <1000 ; i++){ g = i %10 ; b = i / 100 ; s = (i %100)/10 ; if ( ggg+sss+bbb == i ) System.out.println ( i ) ; } }}