题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4464

Problem Description
One day when you are going to clear all your browsing history, you come up with an idea: You want to figure out what your most valued site is. Every site is given a value which equals to the sum of ASCII values of all characters in the URL. For example aa.cc
has value of 438 because 438 = 97 + 97 + 46 + 99 + 99. You just need to print the largest value amongst all values of sites.

Things are simplified because you found that all entries in your browsing history are of the following format: [domain], where [domain] consists of lower-case Latin letters and “.” only. See the sample input for more details.
 
Input
There are several test cases.

For each test case, the first line contains an integer n (1 ≤ n ≤ 100), the number of entries in your browsing history.

Then follows n lines, each consisting of one URL whose length will not exceed 100.

Input is terminated by EOF.
 
Output
For each test case, output one line “Case X: Y” where X is the test case number (starting from 1) and Y is a number indicating the desired answer.
 
Sample Input
1
aa.cc
2
www.google.com
www.wikipedia.org
 
Sample Output
Case 1: 438
Case 2: 1728
 
Source

题意:

求最大的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的和)的更多相关文章

  1. Browsing History

    hdu4464:http://acm.hdu.edu.cn/showproblem.php?pid=4464 题意:就是统计n个字符串中每个字符串每个字符对印的Asci,然后输出最大的长度. 题解:水 ...

  2. hdu 4464 水

    http://acm.hdu.edu.cn/showproblem.php?pid=4464 现场赛总会有水题,这就是最水的一道,预计也就是能当高校的上机题,保研用,呵呵~~~ #include &l ...

  3. 【HDU - 4342】History repeat itself(数学)

    BUPT2017 wintertraining(15) #8C 题意 求第n(n<2^32)个非完全平方数m,以及\(\sum_{i=1}^m{\lfloor\sqrt i\rfloor}\) ...

  4. 最大ASCII的和问题

    问题:One day when you are going to clear all your browsing history, you come up with an idea: You want ...

  5. man ascii

    Linux 2.6 - man page for ascii (linux section 7) - Unix & Linux Commands Linux 2.6 - man page fo ...

  6. ASCII 码对应表

    Macron symbol ASCII CODE 238 : HTML entity : [ Home ][ español ] What is my IP address ? your public ...

  7. 2012 Asia Chengdu Regional Contest

    Browsing History http://acm.hdu.edu.cn/showproblem.php?pid=4464 签到 #include<cstdio> #include&l ...

  8. A Secure Cookie Protocol 安全cookie协议 配置服务器Cookie

    Title http://www.cse.msu.edu/~alexliu/publications/Cookie/cookie.pdf AbstractCookies are the primary ...

  9. What's new in Windows 10 Enterprise with Microsoft Edge.(Windows 10 新功能)

    What's new in Windows 10 Enterprise with Microsoft Edge --带有Edge浏览器的Windows 10 企业版的新功能 本文摘录自公司群发邮件, ...

随机推荐

  1. 图片延时加载jquery.inview.js用法详解

    我们在网站上总能见到这样的效果,若是有图片,图片都是先用loading加载一小段时间,然后紧接着出来要显示的图片,即效果如下: v2_loading.gif,几秒钟时间过渡到v2_pic_01_s.j ...

  2. 《javascript dom编程艺术》笔记(二)——美术馆示例

    这几天把这本书看完了,里面大部分知识我已经会了,所以看得就略简单,好多地方都没有再去动手去做,我知道这样是不对的,以后补吧. 现在我要做的是把这本书的笔记完结掉,不然总觉得有啥事没有做. 这个版本不是 ...

  3. MYSQL 用户

    MYSQL 并没有与SQL Server一样的两个级别的主体,它只有user. user 的信息都保存在mysql 数据库的 user 表中:我想也可以用insert 的方式新建用户,只是这种尝试还没 ...

  4. SAR 图像

    http://www.dlr.de/hr/en/desktopdefault.aspx/tabid-2326/3776_read-5679/

  5. wifi相关协议

    IEEE 802.11Wi-Fi 协议摘要 协议 频率 信号 最大,数据率 传统802.11 2.4GHz FHSS或DSSS 2Mbps 802.11a 5GHz OFDM 54Mbps 802.1 ...

  6. Referrer 还是 Referer?

    上回我写了一篇文章介绍「Referrer Policy」,有小伙伴看完后问我:Referrer 这个单词到底怎么拼,为什么有时候中间有两个 r,有时候只有一个? 是的,这是一个很有趣的问题,这里就给有 ...

  7. 各种字符串Hash函数比较

    常用的字符串Hash函数还有ELFHash,APHash等等,都是十分简单有效的方法.这些函数使用位运算使得每一个字符都对最后的函数值产生影响.另外还有以MD5和SHA1为代表的杂凑函数,这些函数几乎 ...

  8. A Simple Problem with Integers(线段树,区间更新)

    A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 83822   ...

  9. Oracle 11g新特性虚拟列分区

    如今有个需求:一个单据表要依照月份来分区.假设是在Oracle 10g上,仅仅能再加一个字段. 在Oracle 11g以后就不一样了.能够用虚拟列处理. SQL> select * from v ...

  10. Node.cloneNode()方法

    概述 返回调用该方法的节点的一个副本. 语法 var dupNode = node.cloneNode(deep);node将要被克隆的节点dupNode克隆生成的副本节点deep 可选是否采用深度克 ...