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 |
Re:hint太凶残了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator