uva 10008
来源:互联网 发布:vegas13是电脑软件 编辑:程序博客网 时间:2024/06/15 01:51
//
// main.cpp
// data structure
//
// Created by 戴志扬 on 16/9/7.
// Copyright © 2016年 sky.dai. All rights reserved.
//
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
////////////
vector<int>lettercount(26,0);
int main()
{
int n,i,index; //n组测试数据
char str[101];
cin>>n;
getchar();
while (n--)
{
gets(str);
unsignedlong len = strlen(str);
for (index=0;index<len;index++)
{
if('a'<=str[index] && str[index]<='z')
str[index] = str[index]-'a'+'A';
}
for(index=0;index<len;index++)
{
if('A'<=str[index] && str[index]<='Z')
lettercount[str[index]-'A']++;
}
} //统计好各字母的count;
int max =0;
for (i=0;i<26;++i)
{
if(lettercount[i]>max)
max = lettercount[i];
}
for (int j=max;j>0;j-- )
{
for(i=0;i<26;i++)
if(lettercount[i]==j)
printf("%c %d\n",'A'+i,lettercount[i]);
}
return0;
}
- uva 10008
- uva 10008
- uva
- UVA
- UVA
- UVA
- uva
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- UVA
- 忘记开机密码解决办法
- 数据库同时更新多个字段
- 【demo记录】mob短信验证(GUI和无GUI)
- RasUpdateConnection
- eclipse --- 新建JSP页面默认模版设置
- uva 10008
- Scala Cookbook翻译 Chapter 2.Numbers 第一部分
- 【模拟】ECNA 2015 I What's on the Grille? (Codeforces GYM 100825)
- http协议简介
- Qt QThread 爬坑之旅(一)
- Comparator_Integer
- Leetcode 237. Delete Node in a Linked List
- Android自定义小星星评分控件
- Exception has been thrown by the target of an invocation 解决方案