(
intdiv = 2; div * div <= num; ++div) {
37 // Check 'div' is divisor of 'num'. 39 // If both divisor are same, add once to 'sum' 40 if(div == (num / div)) {
43 // If both divisor are not the same, add both to 'sum'. 44sum += (div + (num / div));
74std::cout <<
"All tests have successfully passed!"<< std::endl;
82 tests();
// perform self-tests implementationsstatic void tests()
Self-test implementations.
int main()
Main function.
bool are_amicable(int x, int y)
Function to check whether the pair is amicable or not.
int sum_of_divisor(int num)
Function to calculate the sum of all the proper divisor of an integer.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4