1 solutions

  • 0
    @ 2025-12-2 15:43:09

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    char a;
    int s,t;
    int main()
    {
    	cin>>a;
    	if(a=='F')
    	s++;
    	else if(a=='A')
    	t++;
    	while(a!='E')
    	{
    		cin>>a;
    		if(a=='F')
    		s++;
    		else if(a=='A')
    		t++;
    		if(s==11 && (s-t)>=2 || s>11 && (s-t)>=2)
    		cout<<s<<":"<<t<<endl,s=0,t=0;
    		else if(t==11 && (t-s)>=2 || t>11 && (t-s)>=2)
    		cout<<s<<":"<<t<<endl,s=0,t=0;
    	}
    	if(s!=0 || t!=0)
    	cout<<s<<":"<<t;
    	return 0;
    }
    
    • 1

    Information

    ID
    661
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    2
    Accepted
    2
    Uploaded By