Guest User

Untitled

a guest
Oct 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main() {
  4. int n;
  5. setlocale(LC_ALL, "Rus");
  6. cin >> n;
  7. int i = n / 2;
  8. while (n%i != 0) i--;
  9. if (i != 1) cout << "наиб. делитель " << i << endl;
  10. else cout << "число простое n";
  11. system("pause");
  12. return 0;
  13. }
  14.  
  15. for (int i = n; i > 0; i--) {
  16. if n%i==0 break;//here value i that you find
  17. }
Add Comment
Please, Sign In to add comment