| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么呢?wa!求指点!#include "iostream"
#include "math.h"
using namespace std;
int main()
{
int i,j,k,n,max=1000000000;
int max_i,max_j,max_k;
cin>>n;
for (i=1;i<=n/2;i++)
{
if (n%i==0)
{
for (j=1;j<=n/i;j++)
{
k = i*j;
if (n%k == 0)
{
{
k = n/k;
if (2*(i*j+j*k+k*i)<max)
{
max = 2*(i*j+j*k+k*i);
max_i = i;
max_j = j;
max_k = k;
}
}
}
}
}
}
cout<<max_i<<" "<<max_j<<" "<<max_k<<"\n";
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator