对了三个点
查看原帖
对了三个点
1066396
szm111213楼主2024/1/6 09:29

求各位大佬帮一帮

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int s,maxx1=-2e9,maxx2=-2e9;
	cin >> s;
	for(int i=2;i<=s;i++)
	{
		for(int j=2;j<=s;j++)
		{
			if (s % j == 0)
	        { 
		        if(s/j >= maxx1)
		        {
		        	maxx1=s/j;
				}
		        break;
	        }
		}
		if (s % i == 0)
	    { 
			if(s/i >= maxx2)
		    {
		       	maxx2=s/i;
			}
		    continue;
	    }
	}
	cout << maxx1*maxx2;
	return 0;
}
2024/1/6 09:29
加载中...