mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Resolve errors
This commit is contained in:
parent
30ee762347
commit
583264da0f
@ -28,7 +28,7 @@ int number_of_positive_divisors(int n) {
|
|||||||
prime_exponent_count.push_back(prime_count);
|
prime_exponent_count.push_back(prime_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(n > 1) {
|
if (n > 1) {
|
||||||
prime_exponent_count.push_back(1);
|
prime_exponent_count.push_back(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,12 +44,13 @@ int number_of_positive_divisors(int n) {
|
|||||||
int main() {
|
int main() {
|
||||||
int n;
|
int n;
|
||||||
std::cin >> n;
|
std::cin >> n;
|
||||||
if(n < 0) {
|
if (n < 0) {
|
||||||
n = -n;
|
n = -n;
|
||||||
}
|
}
|
||||||
if(n == 0) {
|
if (n == 0) {
|
||||||
std::cout << "All non-zero numbers are divisors of 0 !" << std::endl;
|
std::cout << "All non-zero numbers are divisors of 0 !" << std::endl;
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Number of positive divisors is : " << number_of_positive_divisors(n) << std::endl;
|
std::cout << "Number of positive divisors is : ";
|
||||||
|
std::cout << number_of_positive_divisors(n) << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user