added double jump and sitting state
This commit is contained in:
parent
2e5c5a8dde
commit
90d07dde3f
148 changed files with 13050 additions and 0 deletions
22
term1/seminar05_iterators/04_is_identifier/main.cpp
Normal file
22
term1/seminar05_iterators/04_is_identifier/main.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <cctype>
|
||||
|
||||
using std::cout, std::endl, std::string, std::string_view;
|
||||
|
||||
bool isIdentifier(string_view sv) {
|
||||
bool is = true;
|
||||
if (!(std::isalpha(sv[0]) || sv[0] == '_'))
|
||||
return false;
|
||||
if (std::all_of(sv.begin(), sv.end(), [](const char c){ return isalpha(c) || isdigit(c) || c == '_' ;}))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int main() {
|
||||
string s;
|
||||
getline(std::cin, s);
|
||||
cout << isIdentifier(s) << endl;
|
||||
}
|
||||
Reference in a new issue