本地测试全是YES,怎么肥四????求助SOS(QAQ)!
查看原帖
本地测试全是YES,怎么肥四????求助SOS(QAQ)!
768764
joey007楼主2022/11/24 18:32

用大脑演算了一遍,

完全没有错;

看计算机的结果差点喷了

很懵*

帮帮“蔡(只因)”吧,大佬们!!!
源代码:
#include <iostream>QAQ
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main(){
	string str;
	getline(cin,str);
	char ch[26];
	int timer = 0;
	int times = 1;
	bool bol = false;
	for(int i = 0;i<str.length();i++){
		if(str[i] == '('){
			while(str[i+1] != ')'){
				i++;
				if((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' || str[i] <= 'Z')){
					ch[timer] = str[i];
					timer++;
				}
			}
		}
	}
	for(int i = 0;i<timer;i++){
		for(int j = i;j<timer;j++){
			if(ch[j] == ch[i]){
				bol = true;
				break;
			}
		}
		if(bol){
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}
2022/11/24 18:32
加载中...