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

Re:hint太凶残了

Posted by cz908640443 at 2013-02-16 13:32:17 on Problem 2656
In Reply To:hint太凶残了 Posted by:qingsong3333 at 2012-12-10 14:45:38
太兇殘了。。果斷要改改。。

#include <stdio.h>

int a, b, n, i;

int main(){
	while(scanf("%d", &n)&&n) {
		int maxday, maxvalue = -1;
		for (i = 0; i < n; i++) {
			scanf("%d%d", &a, &b);
			if (a + b > maxvalue) {
				maxvalue = a + b;
				maxday = i + 1;
			}
		}
		maxvalue < 9? printf("0\n"):printf("%d\n", maxday);
	}
	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