AddO1f

Lab4_1

Oct 11th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include "iomanip"
  4. #include "math.h"
  5.  
  6. using namespace std;
  7.  
  8. int _tmain(int argc, _TCHAR* argv[])
  9. {
  10.     int i,s,p,k,l,m;
  11.     char mas[1000];
  12.     char mas1[1000];
  13.     char mas2[1000];
  14.     i=p=l=m=s=0;
  15.     cout << "Enter k: ";
  16.     cin >> k;
  17.     cout << "Enter mas[k]: ";
  18.     for (i=0;i<k;i++)
  19.     {
  20.         cin >> mas[i];
  21.         //mas[i]=l;
  22.         if (isdigit(mas[i])) {mas1[s]=mas[i]; cout«mas1[s]; s++;}
  23.         else {mas2[p]=mas[i]; p++;};
  24.     }
  25.     while (l<=p)
  26.     {
  27.         cout<<mas2[l];
  28.         l++;
  29.     }
  30.     system("pause");
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment