Advertisement
TimxAG

Untitled

Oct 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. string st;
  6. int i,count1=0,count2=0;
  7. bool f=false;
  8. cin >> st;
  9. for (i=0; i<st.size(); i++)
  10. {
  11. if (st [ i ] == '?')
  12. {
  13. cout << "No panic";
  14. return 0;
  15. }
  16. if (st [ i] == 'a')
  17. {
  18. cout << "No panic";
  19. return 0;
  20. }
  21. if (st[i] == 'A')
  22. {
  23. if (f)
  24. {
  25. cout<<"No panic";
  26. return 0;
  27. }
  28. count1++;
  29. }
  30. if (st[i] == '!')
  31. {
  32. f=true;
  33. count2++;
  34. }
  35. }
  36. if( ( count1>0) && (count2>0)) cout <<"Panic!";
  37. else cout <<"No panic";
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement