문제 1. 아래와 같이 출력하는 프로그램을 작성하시오
<!--[if !supportEmptyParas]--> <!--[endif]-->
1 | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> |
1 | 1 | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> |
1 | 2 | 1 | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> |
1 | 3 | 3 | 1 | <!--[if !supportEmptyParas]--> <!--[endif]--> |
1 | 4 | 6 | 4 | 1 |
... | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> | <!--[if !supportEmptyParas]--> <!--[endif]--> |
[ 생각열기 ]
첫 번째 줄, 첫 번째 열을 1로 초기화 한 후 다음 줄부터는 바로 위의 왼쪽 값과 바로 위의 값을 더한 값
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
문제 2. 문자열을 정의 된 문자수만큼 오른쪽으로 한 바퀴 회전하여 출력하는 프로그램을 작성하시오
<!--[if !supportEmptyParas]--> <!--[endif]-->
제시 문자열 : DSM123
[출력 문자열]
3DSM12
23DSM1
123DSM
M123DS
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]-->
답이 안나와있어서 ㅠㅠ 도저히 모르겠네요 부탁드립니다
댓글 0