seminar05
This commit is contained in:
parent
1d5f2cac48
commit
c01f40aca3
7 changed files with 108 additions and 1 deletions
18
seminar05_iterators/03_is_uppper/main.cpp
Normal file
18
seminar05_iterators/03_is_uppper/main.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <numeric>
|
||||
#include <cctype>
|
||||
|
||||
using std::string, std::cin, std::cout, std::endl;
|
||||
|
||||
bool strIsUpper(const string& s) {
|
||||
return std::accumulate(s.begin(), s.end(), true, [](bool res, char c) {return res && (!isalpha(c) || isupper(c)); });
|
||||
}
|
||||
|
||||
int main() {
|
||||
string s;
|
||||
getline(cin, s);
|
||||
cout << strIsUpper(s) << endl;
|
||||
}
|
||||
Reference in a new issue