re order 11 and 12

This commit is contained in:
Jidong Xiao
2024-04-02 11:32:30 -04:00
parent b91738d769
commit 2eab6a9f3d
24 changed files with 1617 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
#include <iostream>
bool isHappy(int n) {
}
int main() {
// Test cases
// 2, 4, 5, 6, 17, 18, 20 are not happy numbers.
// 1, 7, 10, 13, 19, 23, 28, 68 are happy numbers.
int testCases[] = {2,4,5,6,17,18,20,1,7,10,13,19,23,28,68};
for (int n : testCases) {
if (isHappy(n)) {
std::cout << n << " is a happy number." << std::endl;
} else {
std::cout << n << " is not a happy number." << std::endl;
}
}
return 0;
}