2018-06-19 12:59:42 +02:00
|
|
|
#include <algorithm>
|
|
|
|
#include <vector>
|
|
|
|
#include <iostream>
|
|
|
|
#include <list>
|
2018-06-17 19:59:35 +02:00
|
|
|
#include "Test.h"
|
|
|
|
|
2018-06-18 15:24:01 +02:00
|
|
|
int main() {
|
|
|
|
Derived * derived = new Derived();
|
|
|
|
|
2018-09-05 01:03:06 +02:00
|
|
|
foo(derived);
|
2018-06-18 15:24:01 +02:00
|
|
|
|
|
|
|
delete derived;
|
2018-06-19 12:59:42 +02:00
|
|
|
|
|
|
|
std::vector<int> v(100);
|
|
|
|
|
|
|
|
for (int j = 0; j < 10; ++j) {
|
|
|
|
v[j*j] = j;
|
|
|
|
}
|
|
|
|
v.push_back(17);
|
|
|
|
printVector(v);
|
|
|
|
|
|
|
|
std::sort(v.begin(), v.end());
|
|
|
|
printVector(v);
|
|
|
|
|
|
|
|
std::transform(v.begin(), v.end(), v.begin(), [] (int i) {return i * 10;});
|
|
|
|
printVector(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
void printVector(std::vector<int> vector) {
|
|
|
|
if(!vector.empty()) {
|
|
|
|
std::cout << "Neuer Vector" << std::endl;
|
|
|
|
for(int i = 0; i < vector.size(); i++) {
|
|
|
|
std::cout <<"i=" << i << "|" << vector[i] << std::endl;
|
|
|
|
}
|
|
|
|
}
|
2018-06-18 15:24:01 +02:00
|
|
|
}
|