std::copy(arr.begin(), arr.end(), std::ostream_iterator<int>(std::cout, " "));
C++ (Qt)for (auto x : arr) { ...}
C++ (Qt)std::copy(arr.begin(), arr.end(), std::ostream_iterator<int>(std::cout, " "));
C++ (Qt)for (size_t i = 0; i < arr.size(); ++i) printf("%8d%s", arr[i], (i % 10) ? "," : "\n");
C++ (Qt)os << string << '\n' << array << "аляхер маляхер" << some_value << endl;
C++ (Qt)template <class Container>class Table {public: Table(const Container &container, int column, const char * tab = "\t") : _container(container), _col(column), _tab(tab) {} friend std::ostream& operator<<(std::ostream &os, const Table &t) { int i = 0; for (const auto & x : t._container) { (++i % t._col) ? os << x << t._tab : os << x << std::endl; } return os; }private: const Container &_container; int _col; const char * _tab;}; ... std::cout << Table<decltype(arr)>(arr, 10) << Table<decltype(arr)>(arr, 3, "...") << endl; std::ostringstream os;os << Table<decltype(arr)>(arr, 10) << Table<decltype(arr)>(arr, 3, "...") << "Аляхер-маляхер" << endl; std::ofstream out("example.txt");out << Table<decltype(arr)>(arr, 10) << Table<decltype(arr)>(arr, 4, "\t") << "Аляхер-маляхер" << endl; // и т.д..
C++ (Qt)std::cout << setprecision(6) << Table<decltype(arr)>(arr, 10) << std::endl;