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

求助,这道题怎么判断一行的结束啊???用while(scanf("%d",&i)==1){可不可啊,谢谢!

Posted by huarui at 2006-12-22 12:58:49 on Problem 1939
	int i;
                  cout<<setiosflags(ios::fixed);
		cout<<setprecision(6);

	while(scanf("%d",&i)==1){
			double res[100][2];
			cout<<i<<" ";
		for(int j=0;j<i;j++){
			scanf("%lf %lf",&res[j][0],&res[j][1]);
		}
				for(int k=0;k<i;k++){
			for(int m=0;m<=1;m++){
				cout<<((res[k%i][m]+res[(k+1)%i][m])/2)<<" ";
			}
			
		}
		cout<<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