Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- char string[12],string1[12];
- cin.getline(string, 12);
- bool isWord = false;
- int c = 0,cc = 11;
- system("cls");
- for (int j = 11; j > 0; j--)
- {
- if (isalpha(string[j]) && !isWord)
- c++;
- cc--;
- if (!isalpha(string[j]))
- {
- isWord = false;
- for (int i = c; i < 11; i++)
- {
- if (isalpha(string[j]) && !isWord)
- string1[i] = string[j];
- if (!isalpha(string[j]))
- isWord = false;
- }
- }
- c = 0;
- }
- for (int i = 0; i < 12; i++)
- cout << string1[i];
- cout << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement