fork download
  1.  
  2.  
  3. #include<iostream>
  4. using namespace std;
  5. int main() {
  6. int n;
  7. //setlocale(LC_ALL, "Rus");
  8. cin >> n;
  9. if (n%2 == 0) cout << "наиб. делитель " << n/2 << endl;
  10. else
  11. {
  12. int i;
  13. for(i = 3; i*i <= n; ++i)
  14. if (n%i == 0) break;
  15. if (i*i <= n) cout << "наиб. делитель " << n/i << endl;
  16. else cout << "число простое \n";
  17. }
  18. }
  19.  
  20.  
Success #stdin #stdout 0.01s 5276KB
stdin
2142972483
stdout
наиб. делитель 714324161