Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

高手帮看看错在那里,小弟初来乍到,多谢了……

Posted by zhaorenliang at 2008-10-05 12:27:01 on Problem 1032
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator