Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void CheckSentence(char a)
- {
- if(( a >= 'a' && a<= 'z' ) || ( a >= 'A' && a <= 'Z' ))
- {
- std::cout << tolower(a)-96 << " ";
- }else if(a == ' ')
- std::cout << 0 << " ";
- }
- int main()
- {
- std::string input;
- std::cout << "Input :";
- std::getline(std::cin,input);
- for(int i = 0; i < input.length(); i++)
- {
- CheckSentence(input[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement