Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main() {
- int n;
- setlocale(LC_ALL, "Rus");
- cin >> n;
- int i = n / 2;
- while (n%i != 0) i--;
- if (i != 1) cout << "наиб. делитель " << i << endl;
- else cout << "число простое n";
- system("pause");
- return 0;
- }
- for (int i = n; i > 0; i--) {
- if n%i==0 break;//here value i that you find
- }
Add Comment
Please, Sign In to add comment