Untitled
unknown
c_cpp
a year ago
528 B
7
Indexable
#include <iostream>
#include <array>
int main()
{
const int MAX_SIZE = 10;
std::array< int, MAX_SIZE > numbers{};
std::cout << "Podaj " << MAX_SIZE << " liczb calkowitych\n";
for( int i = 0; i < MAX_SIZE; ++i )
{
std::cout << "Liczba " << i + 1 << ": ";
std::cin >> numbers[ i ];
}
std::cout << "Wypisanie wszystkich liczb calkowitych\n";
for( const auto& n : numbers )
{
std::cout << n << " ";
}
std::cout << '\n';
return 0;
}
Editor is loading...
Leave a Comment