标签:back sqrt page you ons %s rectangle ret int start
class Solution {
public:
/**
* @param area: web pagea€?s area
* @return: the length L and the width W of the web page you designed in sequence
*/
vector<int> constructRectangle(int area) {
// Write your code here
int start = sqrt(area);
while(area%start != 0 && start<area)
{
start ++;
}
vector<int> res;
res.push_back(start);
res.push_back(area/start);
return res;
}
};
标签:back sqrt page you ons %s rectangle ret int start
原文地址:https://www.cnblogs.com/virgildevil/p/12155486.html