Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- #include <cmath>
- using namespace std;
- string a = "qwertyuiopasdfghjklzxcvbnm";
- int main()
- {
- int n, counter = 0;
- cin >> n;
- for(int i = 0; i < n; i++)
- {
- char c;
- string s;
- cin >> c >> s;
- if(c == '!')
- {
- string st = "";
- for(int j = 0; j < s.size(); j++)
- {
- if(st.find(s[j]) == string::npos)
- st.push_back(s[j]);
- }
- a = st;
- }
- if(c == '.')
- {
- for(int j = 0; j < s.size(); j++)
- a.erase(a.find(s[j]) + a.begin());
- }
- if(c == '?')
- counter++;
- }
- cout << counter << ' ' << a.size();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement