|
|
вернуться в форумWA 8, pls HELP ME! #include <iostream> #include <string> #include <map> #include <vector> #include <cctype> #include <algorithm> #include <math.h> #include <iostream> using namespace std; int main() { int N = 0, k = 0; string s; getline (cin, s); char name; for (auto i = 0; i < (int)s.length(); i++) { name = s[i]; if (name == 'a' || name == 'd' || name == 'g' || name == 'j' || name == 'm' || name == 'p' || name == 's' || name == 'v' || name == 'y' || name == '.' || name == ' ') { k = 1; N += k; } if (name == 'b' || name == 'e' || name == 'h' || name == 'k' || name == 'n' || name == 'k' || name == 't' || name == 'w' || name == 'z' || name == ',') { k = 2; N += k; } if (name == 'c' || name == 'f' || name == 'i' || name == 'l' || name == 'o' || name == 'r' || name == 'u' || name == 'x' || name == '!') { k = 3; N += k; } } cout << N; return 0; } Re: WA 8, pls HELP ME! You forgot 'q' in the second if |
|
|