Advertisement
Guest User

ыекштпы

a guest
May 28th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9.  
  10.     char string[12],string1[12];
  11.     cin.getline(string, 12);
  12.  
  13.     bool isWord = false;
  14.  
  15.     int c = 0,cc = 11;
  16.  
  17.     system("cls");
  18.  
  19.     for (int j = 11; j > 0; j--)
  20.     {
  21.         if (isalpha(string[j]) && !isWord)
  22.             c++;
  23.             cc--;
  24.         if (!isalpha(string[j]))
  25.         {
  26.             isWord = false;
  27.             for (int i = c; i < 11; i++)
  28.             {
  29.                 if (isalpha(string[j]) && !isWord)
  30.                     string1[i] = string[j];
  31.                 if (!isalpha(string[j]))
  32.                 isWord = false;
  33.             }
  34.         }
  35.         c = 0;
  36.     }
  37.     for (int i = 0; i < 12; i++)
  38.         cout << string1[i];
  39.    
  40.     cout << endl;
  41.     system("pause");
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement