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 |
pow(m,1.0/3)外面加上ceil应该就好了In Reply To:改进了很多,怎么还wa啊?郁闷啊! Posted by:radish at 2005-04-04 21:50:47 > #include<iostream.h> > #include<math.h> > int main() > { > int i,j,k,m,n; > cin>>n; > while(n) > { > cin>>m; > for(i=int(pow(m,1.0/3))+1;i>0;i--) > if(m%i==0) > { > m=m/i; > for(j=int(pow(m,0.5))+1;j>0;j--)if(m%j==0) > {k=m/j;cout<<2*(i*j+j*k+k*i)<<endl;goto next;} > } > next: 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