java - Any ways to find out "beautiful numbers" -


a beautiful number number containing 1 type of digit, such these: 0, 4, 44, 55555, 3333.

i write android app finds out if number beautiful or not.

try check how many digits number has, example number has 5 digits(between 10000-99999 , >= 11111)

 if(num % 11111 == 0){      //it beautiful number  }else{      //it not beautiful   } 

this example 5 digit numbers. can develop algorithm checking other num of digits. don't know there algorithm created before.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -