POJ 2136 Vertical Histogram】的更多相关文章

一.Description Write a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the input file and print a vertical histogram that shows how many times each letter (but not blanks, digi…
Vertical Histogram Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21223 Accepted: 10048 Description Write a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the inp…
题目链接:http://poj.org/problem?id=2136 题意不难理解,就是输入四行字符串(每行字符总数不超过72个),统计26个英文字母的数目,并按柱状图的形式输出.我的思路就是,先用一维数组total[]统计每个英文字母的个数,接着找出最大的频率,保存在max中:紧接着用一个二维数组word[][](这个比较关键)记录每一个字母在0-max中是否存储数据,有的话则置1,没有则为0.(假如:字母'A'的频率是2,max = 10,那么word[0][0] = 0, word[0]…
题意:按样例那样模拟…… 解法:模拟…… 代码: #include<stdio.h> #include<iostream> #include<algorithm> #include<string> #include<string.h> #include<math.h> #include<limits.h> #include<time.h> #include<stdlib.h> #include<…
J - Vertical Histogram(1.5.7) Time Limit:1000MS    Memory Limit:65536KB    64bit IO Format:%I64d & %I64u SubmitStatus Description Write a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per…
题目链接:http://poj.org/problem?id=2136 水题WA了半天,结果是数组开小了. #include <stdio.h> #include <string.h> ]; ]= {}; int main() { ; i<; i++) { gets(s); int len=strlen(s); ; j<len; j++) { if(s[j]>='A'&&s[j]<='Z') num[s[j]-'A']++; } } *][*…
#include <iostream> #include <string> #define MAXN 26 using namespace std; int _m[MAXN]; int main() { //freopen("acm.acm","r",stdin); ; string s; int i; int k; memset(_m,,sizeof(_m)); ; k < ; ++ k) { getline(cin,s); ; i…
比较简单,按照样例模拟就好!~ #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <cctype> #include <cmath> #include <algorithm> #include <numeric> #include <vector> #include <map…
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路…
初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (1)图的深度优先遍历和广度优先遍历.     (2)最短路径算法(dijkstra,bellman-ford,floyd,hea…