Codeforces Round 379 (Div. 2) - 734 A. Anton and Danik solution
- #include <stdio.h>
- #include <string.h>
- int main() {
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- int n, anton=0, danik=0;
- char c;
- scanf("%d", &n);
- do {
- scanf("%c", &c);
- if(c=='A') anton++;
- else if(c=='D') danik++;
- } while(n--);
- if(anton<danik) printf("Danik\n");
- else if(danik<anton) printf("Anton\n");
- else printf("Friendship\n");
- //printf("Anton: %d, and Danik:%d.\n", anton, danik);
- return 0;
- }
No comments:
Post a Comment