fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5. #include <queue>
  6. #include <deque>
  7. #include <stack>
  8. #include <set>
  9.  
  10. using namespace std;
  11. using ll = long long;
  12. using ld = long double;
  13. #define el "\n"
  14.  
  15. int main() {
  16. ios::sync_with_stdio(false);
  17. cin.tie(NULL);
  18. ll n;
  19. string s;
  20. cin >> n >> s;
  21. int a=0, d=0;
  22. for (char i:s){
  23. if ( i=='A'){
  24. a+=1;
  25. }
  26. if ( i=='D'){
  27. d+=1;
  28. }}
  29. if (a<d) cout<<"Danik" ;
  30. if(a>d) cout<< "Anton";
  31. if (a==d) cout<<"Friendship";
  32.  
  33.  
  34.  
  35. return 0;
  36. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Friendship