错哪了全RE(C++)
查看原帖
错哪了全RE(C++)
977778
__Harry_Haiyun__楼主2023/5/17 21:45
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	string s,TF[n];
	bool type = false;
	for (int i = 1; i <= n; i++)
	{
		cin >> s;
		for (int j = 0; j < s.length(); j++)
		{
			if (s[j] == 'D' && s[j + 1] == 'X' || s[j] == 'X' && s[j + 1] == 'D')
			{
				TF[i] = "Yes";
				type = true;
				break;
			}
			if (s[j] == s[j + 1] == s[j + 2] == s[j + 3])
			{
				TF[i] = "Yes";
				type = true;
				break;
			}
		}
		if (type == false) TF[i] = "No";
		type = false;
	}
	for (int i = 0; i < n; i++) cout << TF[i] << endl;
	return 0;
}
2023/5/17 21:45
加载中...