LeetCode:Happy Number
1、题目名称 Happy Number(快乐数) 2、题目地址 https://leetcode.com/problems/happy-number/ 3、题目内容 英文: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers. 中文: 设计一个算法,判断一个数字是否“快乐”。快乐数可以被如下流程定义:一个正整数,计算出它各位数字的平方和,得到一个新的数字,再对这个新的数字重复这一过程,直到最后得到数字1或是其他某几个数字的无限循环