一般来说,我需要对字符的存在进行字符串检查,以便字符串可以包含字母和数字,但禁止存在其他字符
cout << "Name the Group(use letters and digits): ";
cin >> title;
while(/*здесь хочу вставить условие*/) {
cout << "You can't use symbols except letters and digits, try again: ";
cin >> title;
}
一般来说,我需要对字符的存在进行字符串检查,以便字符串可以包含字母和数字,但禁止存在其他字符
cout << "Name the Group(use letters and digits): ";
cin >> title;
while(/*здесь хочу вставить условие*/) {
cout << "You can't use symbols except letters and digits, try again: ";
cin >> title;
}
为什么要洗个蒸汽浴,如果它可以更短,使用正则表达式))
UPD: 有趣的是哪个版本的生产力更高,我的(在 的帮助下
regex)或自制函数@n1tr0xs的作者。结果如下:9999次,算术平均值。选项 2快4.36倍。没错,这些都是花。您需要使用更易于理解和方便的选项,例如
regex.它可以是这样的,例如: