Codeforces Round #379 (Div. 2) A. Anton and Danik(水题)
2016-11-21 18:34
573 查看
题目链接:http://codeforces.com/contest/734/problem/A
【中文题意】给你一个n,然后输入一个长度为n的字符串,然后比较在这个字符串中’A’的个数多还是’D’的个数多然后对应输出就可以了。
【AC代码】
【中文题意】给你一个n,然后输入一个长度为n的字符串,然后比较在这个字符串中’A’的个数多还是’D’的个数多然后对应输出就可以了。
【AC代码】
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main() { int n,s1=0,s2=0; char c[100005]; scanf("%d",&n); scanf("%s",c); for(int i=0;i<n;i++) { if(c[i]=='A')s1++; else s2++; } if(s1>s2) { printf("Anton\n"); } else if(s1==s2) { printf("Friendship\n"); } else { printf("Danik\n"); } return 0; }
相关文章推荐
- Codeforces Round #379 (Div. 2) A. Anton and Danik 水题
- Codeforces Round #379 (Div. 2) B. Anton and Digits 水题
- Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题
- Codeforces Round #379 (Div. 2) D. Anton and Chess 水题
- Codeforces Round #379 (Div. 2) A. Anton and Danik
- Codeforces Round #404 (Div. 2) B. Anton and Classes 水题
- Codeforces Round #404 (Div. 2) D. Anton and School - 2
- Codeforces Round #404 (Div. 2):D. Anton and School - 2(范德蒙德恒等式)
- Codeforces Round #251(Div. 2) 439A. Devu, the Singer and Churu, the Joker 水题
- #404(div 2)C. Anton and Fairy Tale(二)
- 组合数学——Codeforces Round #404 (Div. 2) D. Anton and School - 2
- Codeforces Round #311 (Div. 2)-B. Pasha and Tea-水题
- Codeforces Round #379 (Div. 2) C. Anton and Making Potions
- Codeforces Round #379 (Div. 2) E. Anton and Tree
- Codeforces Round #281 (Div. 2) B. Vasya and Wrestling 水题
- Codeforces Round #379 (Div. 2) E. Anton and Tree 树的直径
- Codeforces-734A-Anton and Danik(很水)
- Codeforces Round #379 (Div. 2) C. Anton and Making Potions(枚举+二分)
- Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks 字符串水题
- Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones 水题