#include <iostream>
using namespace std;
int main() {
//배열기반 반복문
int a[5] = { 1, 3, 5, 7, 9 };
for (int i = 0; i < 5; i++) {
cout << a[i];
}
//배열의 크기만큼 실행 a[10]이라면 1357900000 가 출력될것임
for (int i : a) {
cout << i;
}
}
#include <iostream>
using namespace std;
int main() {
//중첩 루프 : 2차원 배열
int temp[4][5]{
{1, 2, 3, 4, 5},
{11, 2, 3, 4, 5},
{111, 2, 3, 4, 5},
{1111, 2, 3, 4, 5}
};
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 5; col++) {
cout << temp[row][col] << endl;
}
}
}