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 c1f5b4efc9ea at 2013-09-20 17:50:26 on Problem 1032
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
	int n;
	int n1=0,n2=0;
	scanf("%d",&n);
	n1=n,n2=n-n1;
	while(1){
		n1--;
		n2=n-n1;
		if(n1==n2)
			break;
		else if(abs(n1-n2)==1)
			break;
	}
	if(n1>n2)
		printf("%d %d",n1,n2);
	else
		printf("%d %d",n2,n1);
	system("pause");
	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