题目链接: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. Struts2部分标签

    由于Struts多用OGNL语言所以使用给类标签之前需引入<%@taglib prefix="s" uri="/struts-tags"%> 1.f ...

  2. 函数指针 如:void (*oper)(ChainBinTreee *p)

    在C语言中,一个函数总是占用一段连续的内存区,而函数名就是该函数所占内存区的首地址.我们可以把函数的这个首地址(或称入口地址)赋予一个指针变量,使该指针变量指向该函数.然后通过指针变量就可以找到并调用 ...

  3. JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度

    网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:document.body.offsetWid ...

  4. Linux中的cron计划任务配置方法(详细)

    cron来源于希腊单词chronos(意为“时间”),指Linux系统下一个自动执行指定任务的程序(计划任务) 1. crontab命令选项 #crontab -u <-l, -r, -e> ...

  5. Python 正则表达式应用【转载】

    将从正则表达式开始讲Python的标准库.正则表达式是文字处理中常用的工具,而且不需要额外的系统知识或经验.我们会把系统相关的包放在后面讲解. 正则表达式(regular expression)主要功 ...

  6. 提高Delphi的编译速度(bpl和bcp)

    delphi的编译速度提高(一) 此博文为原创,转载请注明出处 作者 :二娃 此博文的内容我曾经回答群内和论坛内的网友提问时回答过,现在写第一部分,第二部分,我再给出一个终极的提高速度的方法 我用过d ...

  7. SQLServer2012 和 MariaDB 10.0.3 分页效率的对比

    1. 实验环境      R910服务器, 16G内存 SqlServer 2012   64bit MariaDB 10.0.3   64bit  (InnoDB) 2. 实验表情况 rtlBill ...

  8. iOS中的retainCount

    我们都知道iOS中采用引用计数的技术来管理内存,当一个对象没有任何一个地方引用的时候会自动释放,此时的retainCount为0,而且提供了一个-(NSInteger)retainCount的方法来获 ...

  9. JAVA Layout

    /**  * baidu :组件不会直接放到框架上,而是放在若干个面板上,这些面板再放到窗格上?  * 实际上在JFrame上可直接添加Jbutton  *   * BorderLayout Flow ...

  10. Objective-C内存管理教程和原理剖析(三)

    初学Objective-C的朋友都有一个困惑,总觉得对Objective-C的内存管理机制琢磨不透,程 序经常内存泄漏或莫名其妙的崩溃.我在这里总结了自己对Objective-C内存管理机制的研究成果 ...