1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include <vector>
#include <iostream>
template <typename iter>
void print_sequence(iter beg, iter end)
{
std::cout << "{ ";
while (beg != end)
std::cout << *beg++ << ' ' ;
std::cout << "}\n";
}
int main()
{
std::vector<int> data =
{
0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0,
1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0
};
print_sequence(data.begin(), data.end());
data = { 2, 3, -1, 1, 2, 3, -1, 1, 2, 5, -1, 5, -1, 2, 3, 4, -2 };
print_sequence(data.begin(), data.end());
}
|