6 solutions

  • 0
    @ 2022-11-26 16:23:11
    #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;
    }
    

    Information

    ID
    44
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    999
    Accepted
    238
    Uploaded By