Arrows (UVA 13047) by ynu_a
Contest: 3738    RunID: 20173634    Status: Wrong answer    Date: Sat Oct 14 14:01:03 JST 2017


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    for(int i=1;i<=n;++i){
        string s;
        cin >> s;

        int cnt = 0, ans = -1;
        for(int j=0;j<s.size();++j){
            if(s[j] == '<'){
                cnt = 1;
                char c = s[++j];
                if(c == '-' || c == '='){
                    while(j < s.size() && s[j] == c){
                        cnt++;
                        j++;
                    }
                }
                ans = max(ans, cnt);
                j--;
            }else{
                cnt = 1;
                char c = s[j];
                if(c == '-' || c == '='){
                    while(j < s.size() && s[j] == c){
                        cnt++;
                        j++;
                    }
                }
                if(s[j] == '>')ans = max(ans, cnt);
            }
        }

        cout << "Case " << i << ": " << ans << endl;
    }

    return 0;
}