fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. unsigned n, q = 0;
  6. cin >> n;
  7. for (int i = 1; i <= n; i++)
  8. if (n / i == n % i) q += 1;
  9. cout << q;
  10. return 0;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
5982
stdout
4