|
|
вернуться в форумcompilation error (std::find not found?) #include <iostream> #include <vector> using namespace std; int main(int argc, const char * argv[]) { char c; int total = 0; vector<char> ab1; vector<char> ab2; vector<char> ab3; for (char a = 'a'; a <= 'z'; a+= 3) { ab1.push_back(a); ab2.push_back(a + 1); ab3.push_back(a + 2); } ab1.push_back('.'); ab1.push_back('#'); ab2.push_back(','); ab2.push_back(' '); ab3.push_back('!');
while (cin.get(c)) {
if (find(ab1.begin(), ab1.end(), c) != ab1.end()) total += 1;
if (find(ab2.begin(), ab2.end(), c) != ab2.end()) total += 2;
if (find(ab3.begin(), ab3.end(), c) != ab3.end()) total += 3;
}
cout << total; } |
|
|