|
|
back to boardSolution c++ Posted by Ivan 27 Sep 2019 19:12 #include <iostream> #include <string> using namespace std; int main() {string s; int o=0; getline(cin, s); string b1 = "adgjmpsvy. "; string b2 = "behknqtwz,"; string b3 = "cfilorux!"; for (int k=0; k<s.size();k++) { if (b1.find(s[k]) != string::npos) o++; if (b2.find(s[k]) != string::npos) o+=2; if (b3.find(s[k]) != string::npos) o+=3; } cout<<o; return 0; } |
|
|