Periksa apakah seluruh string adalah huruf besar

#include <iostream>
#include <string>
#include <algorithm>

int main() {
    std::string s = "HELLo";
    if (std::all_of(s.begin(), s.end(), [](unsigned char c){ return std::isupper(c); })) {
        std::cout << "Is uppercase." << '\n';
    } else {
        std::cout << "Is not uppercase." << '\n';
    }
}
Open Oyster