🐎
ABC122-B
ABC122-B AtCoder
#include<iostream>
using namespace std;
int main() {
string S;
int lenS;
int cnt = 0;
int ans = 0;
cin >> S;
lenS = S.length();
for (int i = 0; i < lenS; i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') cnt++;
else cnt = 0;
ans = max(ans, cnt);
}
cout << ans << endl;
return 0;
}
Discussion