4 solutions
-
1
#include<bits/stdc++.h> using namespace std; int main(){ int n,s,j,b; cin>>n; int y=0,k=0; for(int i=1;i<=n;i++){ char x,z; cin>>x>>z; if(x=='J'&&z=='S'){ k++; } else if(x=='S'&&z=='S'){ y++; k++; } else if(x=='B'&& z=='S'){ y++; } else if(x=='J'&&z=='J'){ y++; k++; } else if(x=='S'&&z=='J'){ y++; } else if(x=='B'&&z=='J'){ k++; } else if(x=='B'&&z=='B'){ y++; k++; } else if(x=='J'&&z=='B'){ y++; } else if(x=='S'&&z=='B'){ k++; } } if(y>k){ cout<<"xiaoyan"; } else if(k>y){ cout<<"xiaoke"; } else{ cout<<"QAQ"; } return 0; } -
0
#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; int d=0; int e=0; for(int i=1;i<=a;i++) { char b,c; cin>>b>>c; if(b=='J' and c=='B') { d++; } else if(b=='S' and c=='J') { d++; } else if(b=='B' and c=='S') { d++; } else if(c=='J' and b=='B') { e++; } else if(c=='S' and b=='J') { e++; } else if(c=='B' and b=='S') { e++; } } if(e>d) { cout<<"xiaoke"; } else if(d>e) { cout<<"xiaoyan"; } else { cout<<"QAQ"; } return 0; } -
-2
#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; int d=0; int e=0; for(int i=1;i<=a;i++) { char b,c; cin>>b>>c; if(b=='J' and c=='B') { d++; } else if(b=='S' and c=='J') { d++; } else if(b=='B' and c=='S') { d++; } else if(c=='J' and b=='B') { e++; } else if(c=='S' and b=='J') { e++; } else if(c=='B' and b=='S') { e++; } } if(e>d) { cout<<"xiaoke"; } else if(d>e) { cout<<"xiaoyan"; } else { cout<<"QAQ"; } return 0; }
-
-2
#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; int d=0; int e=0; for(int i=1;i<=a;i++) { char b,c; cin>>b>>c; if(b=='J' and c=='B') { d++; } else if(b=='S' and c=='J') { d++; } else if(b=='B' and c=='S') { d++; } else if(c=='J' and b=='B') { e++; } else if(c=='S' and b=='J') { e++; } else if(c=='B' and b=='S') { e++; } } if(e>d) { cout<<"xiaoke"; } else if(d>e) { cout<<"xiaoyan"; } else { cout<<"QAQ"; } return 0; }
- 1
Information
- ID
- 3477
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 1
- Tags
- # Submissions
- 85
- Accepted
- 33
- Uploaded By