Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- string st;
- int i,count1=0,count2=0;
- bool f=false;
- cin >> st;
- for (i=0; i<st.size(); i++)
- {
- if (st [ i ] == '?')
- {
- cout << "No panic";
- return 0;
- }
- if (st [ i] == 'a')
- {
- cout << "No panic";
- return 0;
- }
- if (st[i] == 'A')
- {
- if (f)
- {
- cout<<"No panic";
- return 0;
- }
- count1++;
- }
- if (st[i] == '!')
- {
- f=true;
- count2++;
- }
- }
- if( ( count1>0) && (count2>0)) cout <<"Panic!";
- else cout <<"No panic";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement