#include <iostream>
#include <iomanip>
#include <vector>
void debug_vector(std::vector<double> v) {
std::cout << std::setw(4) << v.size() << "|";
for (std::vector<double>::iterator it=v.begin(); it!=v.end(); it++) {
std::cout << " " << *it;
}
std::cout << "|" << std::endl;
}
int main() {
std::vector<double> Tab1(20), Tab2(Tab1.size()), Tab3(Tab1.size());
for (int i=0; i<Tab1.size(); i++) {
Tab1[i] = Tab2[i] = Tab3[i] = 4;
}
Tab3.front() = Tab3.back() = 5;
Tab3.at(4) = 5; // Dostep z kontrola zasiegu.
std::cout << std::setw(4) << "size|" << std::endl;
debug_vector(Tab1);
debug_vector(Tab2);
debug_vector(Tab3);
if (Tab2 < Tab3) {
std::cout << "Ta nierownosc jest spelniona." << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPHZlY3Rvcj4KCnZvaWQgZGVidWdfdmVjdG9yKHN0ZDo6dmVjdG9yPGRvdWJsZT4gdikgewogIHN0ZDo6Y291dCA8PCBzdGQ6OnNldHcoNCkgPDwgdi5zaXplKCkgPDwgInwiOwogIGZvciAoc3RkOjp2ZWN0b3I8ZG91YmxlPjo6aXRlcmF0b3IgaXQ9di5iZWdpbigpOyBpdCE9di5lbmQoKTsgaXQrKykgewogICAgc3RkOjpjb3V0IDw8ICIgIiA8PCAqaXQ7CiAgfQogIHN0ZDo6Y291dCA8PCAifCIgPDwgc3RkOjplbmRsOwp9CgppbnQgbWFpbigpIHsKICBzdGQ6OnZlY3Rvcjxkb3VibGU+IFRhYjEoMjApLCBUYWIyKFRhYjEuc2l6ZSgpKSwgVGFiMyhUYWIxLnNpemUoKSk7CiAgZm9yIChpbnQgaT0wOyBpPFRhYjEuc2l6ZSgpOyBpKyspIHsKICAgIFRhYjFbaV0gPSBUYWIyW2ldID0gVGFiM1tpXSA9IDQ7CiAgfQogIFRhYjMuZnJvbnQoKSA9IFRhYjMuYmFjaygpID0gNTsKICBUYWIzLmF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