return 0;
}
filln1.cpp
#include ‹stl.h›
#include ‹iostream.h›
int main() {
vector‹int› v(10);
fill_n(v.begin(), v.size(), 42);
for (int i = 0; i ‹ 10; i++) cout ‹‹ v[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
iota1.cpp
#include ‹stl.h›
#include ‹iostream.h›
int main() {
int numbers[10];
iota(numbers, numbers + 10, 42);
for (int i = 0; i ‹ 10; i++) cout ‹‹ numbers[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
nextprm0.cpp
#include ‹stl.h›
#include ‹iostream.h›
int v1[3] = {0, 1, 2};
int main() {
next_permutation(v1, v1 + 3);
for (int i = 0; i ‹ 3; i++) cout ‹‹ v1[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
prevprm0.cpp
#include ‹stl.h›
#include ‹iostream.h›
int v1[3] = {0, 1, 2};
int main() {
prev_permutation(v1, v1 + 3);
for (int i = 0; i ‹ 3; i++) cout ‹‹ v1[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
fill1.cpp
#include ‹stl.h›
#include ‹iostream.h›
int main() {
vector‹int› v(10);
fill(v.begin(), v.end(), 42);
for (int i = 0; i ‹ 10; i++) cout ‹‹ v[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
pair2.cpp
#include ‹stl.h›
#include ‹iostream.h›
int main() {
pair‹int, int› p = make_pair(1, 10);
cout ‹‹ 'p.first = ' ‹‹ p.first ‹‹ endl;
cout ‹‹ 'p.second = ' ‹‹ p.second ‹‹ endl;
return 0;
}
error1.cpp
#include ‹stl.h›