Istanvir389

Find the winner II

Jul 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4.  
  5. { int n,a=0,d=0;
  6. string st ;
  7. cin>>n >> st;
  8. for(int i=0;i<st.length();i++)
  9. {
  10. if (st[i]=='A')
  11. {
  12.  
  13. a++ ;
  14. }
  15.  
  16. else { d++;
  17. }
  18. }
  19.  
  20. if(a>d) cout<< "Anton"<< endl;
  21. else if(d>a) cout<< "Danik" << endl;
  22. else cout<< "Friendship"<< endl;
  23.  
  24.  
  25.  
  26. return 0;
  27.  
  28.  
  29.  
  30. }
Add Comment
Please, Sign In to add comment