Sortowanie wbudowane C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> #include <vector> #include <algorithm> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ using namespace std; int main(int argc, char** argv) { vector<string> t; t.push_back("Ala"); t.push_back("Aba"); t.push_back("Acad"); sort(t.begin(), t.end()); for (vector<string>::iterator it=t.begin(); it!=t.end(); ++it) cout << ' ' << *it; return 0; } |