2012 chengdu现场赛 Browsing History HDU4464(简单字符串)

水题。

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n, cnt = 1;
 9     char str[1000];
10     while(scanf("%d", &n)!=EOF && n)
11     {
12         int max = 0;
13         for(int i=0; i<n; i++)
14         {
15             scanf("%s", str);
16             int len = strlen(str), sum = 0;
17             for(int i=0; i<len; i++){
18                 sum+=(int)str[i];
19             }
20             if(sum>max)max =sum;
21         }
22         printf("Case %d: %d\n", cnt++, max);
23     }
24     return 0;
25 }
View Code

 

posted @ 2013-10-29 01:11  张小豪  阅读(152)  评论(0编辑  收藏  举报