Codeforces 734A Anton and Danik

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/polanwind/article/details/84075604
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int main() {
	int n;
	string s;
	cin >> n >> s;
	int cnt = 0;
	for (int i = 0;i < n;++i) {
		if (s[i] == 'A') {
			cnt++;
		}
	}
	if (cnt > (n - cnt)) {
		cout << "Anton" << endl;
	}
	else if (cnt == (n - cnt)) {
		cout << "Friendship" << endl;
	}
	else {
		cout << "Danik" << endl;
	}
	//system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/polanwind/article/details/84075604