| ||||||||||
| 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 | |||||||||
哪位高手能帮我看一下?这道题我实在想不出哪里不对?#include<stdio.h>
int N,n,i,h,s,s1;
int main()
{
scanf("%d",&N);
while(N--)
{
s=1000000000;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(n%(i*i)==0) {h=n/(i*i);s1=i*i*2+i*h*4;}
if(s1<s) s=s1;
}
if(n%2==0) {h=n/2;s1=4+h*2+4*h;}
if(s1<s) s=s1;
if(n==0) s=0;
printf("%d\n",s);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator