Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <string>
  4.  
  5. #include <cstdlib>
  6.  
  7.  
  8.  
  9. using namespace std;
  10.  
  11.  
  12.  
  13. int main(){
  14. string str;
  15. getline(cin,str);
  16.  
  17.     int amount=0;
  18.  
  19.     for(int i = 0; i<str.length(); i++){
  20.  
  21.         if(str[i]=='a'){
  22.  
  23.                 amount++;
  24.  
  25.         }};
  26.  
  27.         cout<<"amount"<<" "<<amount;
  28.  
  29.  
  30.  
  31.     return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement