| ||||||||||
| 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<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