Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Bonsai Boy of New York Bonsai Trees and Accessories

BlueHost Web Hosting

Liquid Web iThemes WordPress Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Liquid Web Cloud VPS Hosting

10,567 questions

14,363 answers

573 users

How to check if given string contains all uppercase letters in C++

1 Answer

0 votes
#include <iostream>
#include <algorithm>

using std::cout;
using std::endl;
using std::string;

int main()
{
	string s = "CPHPJAVA";

	bool result = std::all_of(s.begin(), s.end(), isupper);

	if (result)
		cout << "yes" << endl;
	else
		cout << "no" << endl;

	return 0;
}


/*
run:

yes

*/

 




answered Feb 5, 2018 by avibootz
...