Untitled
unknown
c_cpp
a year ago
388 B
6
Indexable
#include <iostream>
#include <array>
int main()
{
std::array< int, 10 > tab{ 1, 2, 3, 56, 104, 15, 98, -1, 41, -13 };
for( int i = 0; i < tab.size(); ++i )
{
std::cout << tab[ i ] << " ";
}
std::cout << "\n\n";
// Zakresowa pętla for
for( const auto& n : tab )
{
std::cout << n << " ";
}
return 0;
}
Editor is loading...
Leave a Comment