4232 |
15 Sep 22 |
peter |
// $Id$ |
4232 |
15 Sep 22 |
peter |
2 |
|
4232 |
15 Sep 22 |
peter |
3 |
/* |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2022 Peter Johansson |
4232 |
15 Sep 22 |
peter |
5 |
|
4232 |
15 Sep 22 |
peter |
This file is part of the yat library, https://dev.thep.lu.se/yat |
4232 |
15 Sep 22 |
peter |
7 |
|
4232 |
15 Sep 22 |
peter |
The yat library is free software; you can redistribute it and/or |
4232 |
15 Sep 22 |
peter |
modify it under the terms of the GNU General Public License as |
4232 |
15 Sep 22 |
peter |
published by the Free Software Foundation; either version 3 of the |
4232 |
15 Sep 22 |
peter |
License, or (at your option) any later version. |
4232 |
15 Sep 22 |
peter |
12 |
|
4232 |
15 Sep 22 |
peter |
The yat library is distributed in the hope that it will be useful, |
4232 |
15 Sep 22 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4232 |
15 Sep 22 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4232 |
15 Sep 22 |
peter |
General Public License for more details. |
4232 |
15 Sep 22 |
peter |
17 |
|
4232 |
15 Sep 22 |
peter |
You should have received a copy of the GNU General Public License |
4232 |
15 Sep 22 |
peter |
along with yat. If not, see <https://www.gnu.org/licenses/>. |
4232 |
15 Sep 22 |
peter |
20 |
*/ |
4232 |
15 Sep 22 |
peter |
21 |
|
4232 |
15 Sep 22 |
peter |
22 |
#include <config.h> |
4232 |
15 Sep 22 |
peter |
23 |
|
4232 |
15 Sep 22 |
peter |
24 |
#include <yat/random/random.h> |
4232 |
15 Sep 22 |
peter |
25 |
#include <yat/utility/GetlineIterator.h> |
4232 |
15 Sep 22 |
peter |
26 |
|
4232 |
15 Sep 22 |
peter |
27 |
#include <algorithm> |
4232 |
15 Sep 22 |
peter |
28 |
#include <iostream> |
4232 |
15 Sep 22 |
peter |
29 |
#include <iterator> |
4232 |
15 Sep 22 |
peter |
30 |
#include <string> |
4232 |
15 Sep 22 |
peter |
31 |
#include <vector> |
4232 |
15 Sep 22 |
peter |
32 |
|
4232 |
15 Sep 22 |
peter |
33 |
int main(void) |
4232 |
15 Sep 22 |
peter |
34 |
{ |
4232 |
15 Sep 22 |
peter |
35 |
std::vector<std::string> |
4233 |
15 Sep 22 |
jari |
36 |
lines((theplu::yat::utility::GetlineIterator(std::cin)), |
4232 |
15 Sep 22 |
peter |
37 |
theplu::yat::utility::GetlineIterator()); |
4232 |
15 Sep 22 |
peter |
38 |
theplu::yat::random::random_shuffle(lines.begin(), lines.end()); |
4232 |
15 Sep 22 |
peter |
39 |
std::copy(lines.begin(), lines.end(), |
4232 |
15 Sep 22 |
peter |
40 |
std::ostream_iterator<std::string>(std::cout, "\n")); |
4232 |
15 Sep 22 |
peter |
41 |
return 0; |
4232 |
15 Sep 22 |
peter |
42 |
} |