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 |
Re:高手帮看看错在那里,小弟初来乍到,多谢了……In Reply To:高手帮看看错在那里,小弟初来乍到,多谢了…… Posted by:zhaorenliang at 2008-10-05 12:27:01 > #include<iostream> > using namespace std; > int a=0; > int N; > int main() > {int i ,j; > cin>>N; > for(i=1;i<=N/2;i++) > for(j=N;j>N/2;j--){if((i+j)==N) > { > if(a<(i*j)) {a=(i*j);} > > }} > for(i=1;i<=N/2;i++) > for(j=N;j>N/2;j--){if((i*j)==a&&(i+j)==N) > {cout<<i<<" "; > cout<<j<<endl;} > } > return(0); > 又没说之分两组 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator