Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- //~ vector<int> a = {1,2,1,2,1,3,5};
- //~ int n = (int) a.size();
- //~ int count[6];
- //~ for (int i = 0; i < 6; ++i) {
- //~ count[i] = 0;
- //~ }
- //~ for (int i = 0; i < n; ++i) {
- //~ count[a[i]]++;
- //~ }
- //~ cout << count[2] << '\n';
- string s = "abcdddddez";
- int n = (int) s.size();
- int count[26];
- for (int i = 0; i < 26; ++i) count[i] = 0;
- for (int i = 0; i < n; ++i) {
- count[s[i] - 'a']++;
- }
- cout << count['z' - 'a'] << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement