csansoon

P2.19 P97969 Counting a's (1)

Sep 26th, 2018
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     char c;
  6.     int a=0;
  7.     while (cin >> c) {
  8.         if (c=='a') a++;
  9.     }
  10.     cout << a << endl;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment