Test instructions: Simulate like the example ...
Solution: Simulate ...
Code:
#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<map> #include <queue> #include <set> #include <stack> #include <vector> #define LL Long longusing namespace Std;int alp[30];void cal (string s) {for (int i = 0; i < s.size (); i++) {if (S[i] & Gt;= ' A ' && s[i] <= ' Z ') alp[s[i]-' a ']++; }}int Main () {string S; while (Getline (CIN, s)) {memset (ALP, 0, sizeof ALP); Cal (s); for (int i = 0; i < 3; i++) {getline (CIN, s); Cal (s); } int maxn = 0; for (int i = 0; i < i++) MAXN = max (MAXN, Alp[i]); for (int i = 0, i < MAXN; i++) {for (int j = 0; J < + j + +) {if (j) prin TF (""); if (Alp[j] + i >= maxn) printf ("*"); else printf (""); } puts (""); } for (int i = 0; i <; i++) {if (i) printf (""); printf ("%c", i + ' A '); } puts (""); } return 0;}
POJ 2136 Vertical Histogram