#include <stdio.h>

int main() {
    
    int a[3][9];
    int k=0;
    int i=0;
            for(int f=2; f<5; f++)
            {
                    for(int n=1; n<=9; n++)
                    {
                        a[i][k]= f*n;
                        if(k == 9)
                        {
                            i++;
                            k=0;
                            if(i==4)
                                continue;
                        }
                        k++;
                    }
            }

    for(int i=0; i<3; i++)
    {
        printf("\n");
        printf("%d단:", i+2);
        for(int k=0; k<9; k++)
        {
            if(i == 0)
                printf(" %d,", a[i][k]);
            if(i == 1)
                printf(" %d,", a[i][k]);
            if(i == 2)
                printf(" %d,", a[i][k]);
        }
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: