[ create a new paste ] login | about

Link: http://codepad.org/FvhuTit5    [ raw code | output | fork ]

C++, pasted on Jun 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <set>
#include <cstdlib>
#include <iostream>

int main()
{
	std::set<int> zahlen;
	
	for(size_t i = 0; i < 10; ++i)
		zahlen.insert(std::rand() % 10); //Zufallswerte reinschreiben
	
	for(std::set<int>::const_iterator it = zahlen.begin(); it != zahlen.end(); ++it)
		std::cout << *it << ' '; //keine Doppelten
}


Output:
1
1 2 3 5 6 7 9 


Create a new paste based on this one


Comments: