Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- char c;
- string line;
- getline(cin, line);
- istringstream iss(line);
- vector<int> V(26, 0);
- while(iss >> c){
- V[static_cast<int>(c-65)] += 1;
- }
- for(auto &v: V) {
- cout << v << " ";
- }
- cout << '\n';
- for(int i{0};i<V.size();i++) {
- if (V[i]!=0) cout << static_cast<char>(i+65) << " ";
- else cout << "* ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment