IT/C and C++

많은문자열다루기

KSI 2005. 7. 13. 07:18
#include <stdio.h>

void main()
{
        char *arCon\[]\[4] = {            {"대한민국","일본","북조선 인민 민주주의 공화국","베트남"},
            {"미국","브라질","칠레","아르헨티나"},
            {"영국","헝가리","체코슬로바키아","루마니아"},
            {"남아프리카 공화국","우간다","나이지리아","케냐"},
            {"오스트레일리아","뉴질랜드","김상형 공화국","박미영 공화국"}
        };

        int x,y;

        for(x = 0; x < sizeof(arCon)/sizeof(arCon\[0]); x++)
        {
                for(y = 0; y < sizeof(arCon\[0])/sizeof(arCon\[0]\[0]); y++)
                {
                                printf("%s", arCon\[x]\[y]);
                                if(y != 3) printf(", ");
                }
                printf("\\n");
        }

}