hdu 4464 Browsing History
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4464
题意:
求字符串的ascall码和最大的一个字符串
View Code
1 1 #include <iostream> 2 2 #include <cmath> 3 3 #include <cstring> 4 4 #include <cstdio> 5 5 #include <string> 6 6 #include <stdlib.h> 7 7 #include <algorithm> 8 8 using namespace std; 9 9 typedef long long LL; 10 10 const LL Mod= 1e9+7; 11 11 12 12 int main( ) 13 13 { 14 14 int N, Ca=1; 15 15 char s[1000]; 16 16 while( scanf("%d", &N )==1 ){ 17 17 printf("Case %d: ", Ca++ ); 18 18 int ans=0; 19 19 for( int i=0; i<N; ++ i ){ 20 20 scanf( "%s", s ); 21 21 int t=strlen(s ), temp=0; 22 22 for( int j=0;j<t; ++j ) 23 23 temp+=s[j]; 24 24 ans=ans>temp?ans:temp; 25 25 } 26 26 printf("%d\n", ans ); 27 27 28 28 } 29 29 return 0; 30 30 }