Problem: One day is going to clear all your browsing the history, and you come a idea:you want to the figure out what yo ur 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 have value of 438 because 438 = 97 + 97 + 46 + 99 + 99. You just need to print the largest value amongst all values of sites.
Things is simplified because you found it all entries in your browsing history is of the following format: [domain], W Here [domain] consists of lower-case Latin letters and "." Only. See the sample input for more details.
Input
There is several test cases.
For each test case, the first line contains a integer n (1≤n≤100), the number of entries in your browsing history.
Then follows n lines, each consisting of one URL whose length would not exceed 100.
Input is terminated by EOF.
Output
For each test case, output one line "Case X:y" where X was the test Case number (starting from 1) and Y is a number indica Ting the desired answer.
Sample Input
1
aa.cc
2
www.google.com
www.wikipedia.org
Sample Output
Case 1:438
Case 2:1728
Answer: Test instructions is to give n a string, the maximum ASCII code and.
#include <stdio.h>
#include <string.h>
int main () {
int N, t = 0;
while (scanf ("%d", &n)!=eof) {
int maxx = 0;
while (n--) {
int i, TMP = 0;
Char s[105];
scanf ("%s", s);
for (i = 0; s[i]; i++)
TMP + = S[i];
if (tmp > Maxx)
MAXX = tmp;
}
printf ("Case%d:%d\n", ++t, Maxx);
}
return 0;
}
Maximum ASCII and problem