Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int funcN(string pred)
- {
- int n = 0;
- for (int i = 0; i < pred.length(); i++)
- {
- if ((pred[i] == 'n') || (pred[i] == 'N'))
- {
- n++;
- }
- }
- return n;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- string pred1, pred2;
- cout << "Введите первое предложение:" << endl;
- cin >> pred1;
- cout << "Введите второе предложение:" << endl;
- cin >> pred2;
- cout << "Количество \"н\" в предложениях : " << funcN(pred1) + funcN(pred2) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement