fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n,a,d;
  5.  
  6. int main(){
  7. cin >> n;
  8. char c;
  9. for (int i = 1; i <=n; i++){
  10. cin >> c;
  11. if (c=='A') a++;
  12. else d++;
  13. }
  14. if (a>d) cout << "Anton";
  15. if (a<d) cout << "Danik";
  16. if (a==d) cout << "Friendship";
  17. return 0;
  18. }
Success #stdin #stdout 0s 15240KB
stdin
2
DA
stdout
Friendship