Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string name = "";
- getline(cin, name);
- bool isValid = true;
- double totalNames = 0;
- double validNames = 0;
- double invalidNames = 0;
- while (true) {
- isValid = true;
- totalNames++;
- if (name == "Statistic")
- break;
- for (int i = 0; i < name.length(); i++) {
- if (!isalpha(name[i])) {
- cout << "Invalid name." << endl;
- invalidNames++;
- isValid = false;
- break;
- }
- }
- if (isValid) {
- validNames++;
- name = to_string(toupper(num[0]));
- cout << name << endl;
- }
- getline(cin, name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment