社区讨论

50求调

B2155合法 C 标识符参与者 2已保存回复 2

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
2 条
当前快照
1 份
快照标识符
@mliqlipk
此快照首次捕获于
2026/02/12 08:45
上周
此快照最后确认于
2026/02/12 10:10
上周
查看原帖
CPP
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> s;
	int l = s.length();
	if (s[0] >= '0' and s[0] <= '9') {
		cout << "no";
		return 0;
	}
	for (int i = 0 ; i < l ; i ++) {
		if (!((s[i] > 'a' and s[i] <= 'z') or (s[i] >= 'A' and s[i] <= 'Z') or s[i] == '-' or (s[i] >= '0' and s[i] <= '9'))) {
			cout << "no";
			return 0;
		}
	}
	cout << "yes";
	return 0;
}

回复

2 条回复,欢迎继续交流。

正在加载回复...