Skip to content

Commit 878a344

Browse files
committed
Added 734A - Anton and Danik.cpp
1 parent 65056d6 commit 878a344

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

734A - Anton and Danik.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
// Code Written By: Vikash Patel
5+
6+
int main()
7+
{
8+
int n;
9+
cin>>n;
10+
string s;
11+
cin>>s;
12+
int a=0,d=0;
13+
for(int i=0;i<n;i++)
14+
{
15+
if(s[i]=='A')
16+
a++;
17+
else
18+
d++;
19+
}
20+
if(a>d)
21+
cout<<"Anton"<<endl;
22+
else if(a<d)
23+
cout<<"Danik"<<endl;
24+
else
25+
cout<<"Friendship"<<endl;
26+
}
27+
28+
29+
30+
31+
32+
33+
34+

0 commit comments

Comments
 (0)