Phoenix_x

Untitled

Nov 29th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. // ConsoleApplication7.cpp : Defines the entry point for the console application.
  2. //
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. void main()
  9. {
  10.     char symbol;
  11.     cout << "symbol: ";
  12.     cin >> symbol;
  13.  
  14.     string word;
  15.     cout << "word: ";
  16.     cin >> word;
  17.  
  18.  
  19.     int broyach = 0;
  20.  
  21.     for (int i = 0; i < word.size(); i++)
  22.         if (word[i] == symbol) broyach++;
  23.  
  24.     cout << broyach;
  25. }
Add Comment
Please, Sign In to add comment