题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4464
1 aa.cc 2 www.google.com www.wikipedia.org
Case 1: 438 Case 2: 1728
题意:
求最大的ASCII的和!
代码如下:
#include <cstdio> #include <cstring> int main() { int cas = 0; int n; char s[117]; while(~scanf("%d",&n)) { getchar(); int maxx = 0; int sum = 0; for(int i = 0; i < n; i++) { gets(s); sum = 0; int len = strlen(s); for(int j = 0; j < len; j++) { sum += s[j]; } if(sum > maxx) maxx = sum; } printf("Case %d: %d\n",++cas,maxx); } return 0; }
HDU 4464 Browsing History(最大ASCII的和)
原文地址:http://blog.csdn.net/u012860063/article/details/40404223