codeforces 734A-C语言解题报告
生活随笔
收集整理的這篇文章主要介紹了
codeforces 734A-C语言解题报告
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
734A題目網址
題目解析
1.輸入n個結果,再輸入每一個結果(A或D),統計A和D的數目,A>D,則輸出Anton,A<D,輸出Danik,A==D,輸出Friendship
代碼
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int n=0,A=0,D=0;char s[100000]={'0'};scanf("%d",&n);getchar();scanf("%s",s);for(int i=0;i<strlen(s);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");}getchar();system("pause");return 0; }總結
以上是生活随笔為你收集整理的codeforces 734A-C语言解题报告的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 收入类账户期末余额在哪方
- 下一篇: 平安分期卡是什么卡种?用途竟然是这样