Advertisement
TimxAG

Untitled

Oct 29th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 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] == 'A')
  12. {
  13. if (f)
  14. {
  15. cout<<"No panic";
  16. return 0;
  17. }
  18. count1++;
  19. }
  20. else
  21. if (st[i] == '!')
  22. {
  23. f=true;
  24. count2++;
  25. }
  26. else
  27. {
  28. cout << "No panic";
  29. return 0;
  30. }
  31. }
  32. if( ( count1>0) && (count2>0)) cout <<"Panic!";
  33. else cout <<"No panic";
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement