Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <ctime>
- #include <vector>
- #include <windows.h>
- using namespace std;
- int main(int argc, char *argv[])
- {
- srand(time(NULL));
- vector <char> wyraz;
- vector <char> pomieszany;
- string input;
- int znak;
- cout << "Podaj wyraz" << endl;
- getline(cin, input);
- for (int x = 0; x < input.length(); x++)
- wyraz.push_back(input[x]);
- do
- {
- znak = rand() % wyraz.size();
- pomieszany.push_back(wyraz[znak]);
- wyraz.erase(wyraz.begin()+znak);
- }
- while (!wyraz.empty());
- for (int x = 0; x < pomieszany.size(); x++)
- cout << pomieszany[x];
- cout << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement