Skip to content

Commit 536cb14

Browse files
Revert "style: remove interaction with the user (TheAlgorithms#3006)"
This reverts commit bde09c2.
1 parent a5d91f8 commit 536cb14

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

math/number_of_positive_divisors.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
**/
2424

2525
#include <cassert>
26+
#include <iostream>
2627

2728
/**
2829
* Function to compute the number of positive divisors.
@@ -79,5 +80,13 @@ void tests() {
7980
*/
8081
int main() {
8182
tests();
83+
int n;
84+
std::cin >> n;
85+
if (n == 0) {
86+
std::cout << "All non-zero numbers are divisors of 0 !" << std::endl;
87+
} else {
88+
std::cout << "Number of positive divisors is : ";
89+
std::cout << number_of_positive_divisors(n) << std::endl;
90+
}
8291
return 0;
8392
}

0 commit comments

Comments
 (0)