3 solutions

  • 1
    @ 2026-8-4 11:21:43
    #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
      @ 2026-5-31 18:07:27

      #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
        @ 2026-5-1 15:58:54

        #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
        81
        Accepted
        30
        Uploaded By