Untitled

mail@pastecode.io avatar
unknown
c_cpp
9 days ago
388 B
1
Indexable
Never
#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;
}
Leave a Comment