csansoon

P6.03 P75149 Looking for an a

Nov 7th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int main() {
  7.     char c;
  8.     bool isThereAnyA=false;
  9.     while (cin>>c&&c!='a'&&c!='.') {}
  10.     if (c=='a') isThereAnyA=true;
  11.    
  12.    
  13.     if (isThereAnyA) cout << "yes"<<endl;
  14.     else cout << "no"<<endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment