Let's say. given the sentence: "I want to learn C ++." We need to find the number of occurrences of the letter "o" in the sentence. How to do this if the code below can only count Latin letters?
#include <iostream> #include <string> using namespace std; int main() { setlocale(LC_CTYPE, "Russian"); string s; getline(cin, s); int col = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'О' || s[i] == 'о') col++; } cout << col; return 0; }