AddO1f

Говно собачье

Dec 9th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "string.h"
  3. #include "iostream"
  4. #include "iomanip"
  5. #include "math.h"
  6.  
  7. using namespace std;
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {
  11.         char st[40];
  12.         int chet,stroka,chisla,poisk,vivod;
  13.         cout<<"Enter posledov:";
  14.         cin.getline(st, 39);
  15.         stroka=strlen(st);
  16.         chisla=chet=0;
  17.     poisk=vivod=1;
  18.         while (poisk<=stroka)
  19.         {
  20.         while (chet<stroka)
  21.         {
  22.                     if ((st[chet]==' ') && (chisla==poisk))
  23.                     {
  24.                     while (vivod<=poisk+1)
  25.                     {
  26.                         cout<<st[chet-vivod];
  27.                         vivod++;
  28.                     }                  
  29.                     poisk=stroka+1;
  30.                 }
  31.                 else if (st[chet]==' ') {chisla=0;}
  32.                 else chisla++;
  33.                 chet++;    
  34.             }
  35.             poisk++; chisla=chet=0;
  36.         }
  37.         system("pause");
  38.         return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment