标签:
public class Solution { public boolean isHappy(int n) { int sum=0; if(n==1||n==7) return true; else if(n>1&&n<9) return false; while(n>0){ sum+=(n%10)*(n%10); n/=10; } return isHappy(sum); } }
标签:
原文地址:http://www.cnblogs.com/qiaomu/p/4469969.html