구구단을 이용한 2차원 배열 출력 프로그램

나무에물주기·2022년 10월 21일
0

Coding Test

목록 보기
73/77
#include <iostream>
using namespace std;

// 구구단을 이용해 2차원 배열 출력하기

int main(void)
{

    int i, j;
    int gugudan[10][10];
    for(i = 1; i < 10; i++)
    {
        cout << "[  " << i << "단 ]\n\n";
        for(j = 1; j < 10; j++)
        {
            gugudan[i][j] = i * j;
            cout << i << " x " << j << " = " << gugudan[i][j] << endl;
        }
        cout << "\n";
    }

    return 0;
}
profile
개인 공부를 정리함니다

0개의 댓글