🐎

ABC122-B

2022/05/03に公開

ABC122-B AtCoder

https://atcoder.jp/contests/abc122/tasks/abc122_b

#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