#include <iostream>
using std::cout;
using std::cin;
using std::endl;
void draw(char, char);
int main(void) {
char a, b;
cin>>a>>b;
draw(a, b);
return 0;
}
void draw(char begin, char end) {
for(int i=0; i<= (end-begin); i++) {
for(int j=0; j<=i; j++) {
cout<<(char)(begin+j);
}
cout<<endl;
}
}
실행 결과 ¶
Input:
AZ
Output:
A
AB
ABC
ABCD
ABCDE
ABCDEF
ABCDEFG
ABCDEFGH
ABCDEFGHI
ABCDEFGHIJ
ABCDEFGHIJK
ABCDEFGHIJKL
ABCDEFGHIJKLM
ABCDEFGHIJKLMN
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNOP
ABCDEFGHIJKLMNOPQ
ABCDEFGHIJKLMNOPQR
ABCDEFGHIJKLMNOPQRS
ABCDEFGHIJKLMNOPQRST
ABCDEFGHIJKLMNOPQRSTU
ABCDEFGHIJKLMNOPQRSTUV
ABCDEFGHIJKLMNOPQRSTUVW
ABCDEFGHIJKLMNOPQRSTUVWX
ABCDEFGHIJKLMNOPQRSTUVWXY
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Input:
cq
Output:
c
cd
cde
cdef
cdefg
cdefgh
cdefghi
cdefghij
cdefghijk
cdefghijkl
cdefghijklm
cdefghijklmn
cdefghijklmno
cdefghijklmnop
cdefghijklmnopq
Input:
39
Output:
3
34
345
3456
34567
345678
3456789
Input:
98
Output:
(없음)
덧글 ¶
- 아 잉여하다 - 장용운
- 왓더, 아웃풋이 멋지군. 나도 코드 안봤으니, 한번 해볼까 -김태진