Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // laba_4.3_XIII.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_CTYPE, "rus");
- int k,i,j;
- cout<<"Введите k:"<<endl;
- cin>>k;
- char *simv = new char [k];
- cin>>simv[0];
- for (i=1;i<k;i++)
- {
- cin>>simv[i];
- for(j=0;j<i;j++)
- {
- if(simv[j]==simv[i])
- {
- i--;k--;
- }
- }
- }
- cout<<endl;
- for (i=0;i<k;i++)
- cout<<simv[i];
- cout<<endl;
- delete [] simv;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment