ABC122-B

3772 단어 C++AtCodertech

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;
}

좋은 웹페이지 즐겨찾기