Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale>
- #include <string>
- bool main() {
- std::string text("Number 5 is the best!");
- std::locale loc;
- for(unsigned short int len = 0; len != text.length(); len++) {
- if(!std::isdigit(text[len],loc)) {
- std::cout << text[len] << " is not a number" << std::endl;
- }
- else {
- std::cout << text[len] << " is a number" << std::endl;
- }
- }
- system("pause");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement