TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
A happy number is a number whose sum of digits is calculated until the sum is a single digit, and this sum turns out to be 1. More...
#include <iostream>
Go to the source code of this file.
Functions | |
template<typename T > | |
bool | is_happy (T n) |
int | main () |
A happy number is a number whose sum of digits is calculated until the sum is a single digit, and this sum turns out to be 1.
Definition in file happy_number.cpp.
bool is_happy | ( | T | n | ) |
Checks if a decimal number is a happy number
Definition at line 14 of file happy_number.cpp.
int main | ( | void | ) |
Main function
Definition at line 29 of file happy_number.cpp.