#include<cmath> using namespace std; int main(){ int x, i, j, max; cin >> x; for(i = 2; i < sqrt(x); i++){ if(x % i == 0){ j = x / i; break; } } if(i > j) max = i; else max = j; cout << max << endl; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account