题意:统计一个字符串中'A'和'D'的个数那个多。
代码:
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<queue>
#include<bitset>
#include<math.h>
#include<vector>
#include<string>
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
typedef double db;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const db eps=1e-5;
const int N=1e6+10;
const int M=4e6+10;
const ll MOD=1000000007;
const int mod=1000000007;
const int MAX=1000000010;
const double pi=acos(-1.0);
char s[N];
int main()
{
int i,n,a=0,d=0,len;
scanf("%d", &n);
scanf("%s", s);
len=strlen(s);
for (i=0;i<len;i++)
if (s[i]=='A') a++;
else d++;
if (a==d) printf("Friendship\n");
else if (a>d) printf("Anton\n");
else printf("Danik\n");
return 0;
}