解题思路:
设棱长为x,y,z;假设已知面积为a,b,c
那么,xy=a;yz=b;xz=c;
一式除二式得x/z=a/b
x=(a/b)*z
联立xz=c
代入得(a/b)z^2=c
z^2=c*b/a
z=根号下(c*b/a)
然后x,y就都可以求出
AC代码如下:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a,b,c;
cin >> a >> b >> c;
int x,y,z;
x = sqrt(a*c/b);
y = sqrt(a*b/c);
z = sqrt(b*c/a);
int res = (x*2 + y*2 + z*2)*2;
cout << res;
return 0;
}