UVA 1636(p326)----Headshot

#include<iostream>
#include<cstdio>
using namespace std;
string st;
int main()
{
    ios::sync_with_stdio(false);
    while(cin>>st)
    {
        int l=st.length();
        int zero=0;
        int zo=0;
        int zz=0;
        for(int i=0; i<l; i++)
            if(st[i]=='0')
            {
                zero++;
                if(st[(i+1)%l]=='0')
                    zz++;
                if(st[(i+1)%l]=='1')
                    zo++;
            }
        //cout<<zero<<" "<<zz<<" "<<zo<<endl;
        if(l*zz>zero*(zo+zz)) cout<<"SHOOT"<<endl;
        else if(l*zz==zero*(zo+zz)) cout<<"EQUAL"<<endl;
        else cout<<"ROTATE"<<endl;
    }
    return 0;
}

你可能感兴趣的:(UVA 1636(p326)----Headshot)