Quipex

Laba_4.3_XIII

Oct 11th, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. // laba_4.3_XIII.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <clocale>
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.     setlocale(LC_CTYPE, "rus");
  13.     int k,i,j;
  14.     cout<<"Введите k:"<<endl;
  15.     cin>>k;
  16.     char *simv = new char [k];
  17.     cin>>simv[0];
  18.     for (i=1;i<k;i++)
  19.     {
  20.         cin>>simv[i];
  21.         for(j=0;j<i;j++)
  22.         {
  23.             if(simv[j]==simv[i])
  24.             {
  25.                 i--;k--;
  26.             }
  27.         }
  28.     }
  29.     cout<<endl;
  30.     for (i=0;i<k;i++)
  31.         cout<<simv[i];
  32.     cout<<endl;
  33.     delete [] simv;
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment