Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int cons = 0;
- for(int i=0; i<sentence.length(); i++) {
- char currentLetter = sentence[i];
- currentLetter = toupper(currentLetter);
- switch(currentLetter) {
- case 'A':
- case 'E':
- case 'I':
- case 'O':
- case 'U':
- case ' ':
- case '.':
- case ',':
- case '?':
- case '!':
- case '-':
- default
- cons++:
- cout<<endl;
- break;
- }}
- return cons;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement