hy30nq's blog
1076 풀이 본문
728x90
https://codeup.kr/problem.php?id=1076
[기초-반복실행구조] 문자 1개 입력받아 알파벳 출력하기(설명)
C언어기초100제v1.2 : @컴퓨터과학사랑, 전국 정보(컴퓨터)교사 커뮤니티/연구회 - 학교 정보(컴퓨터)선생님들과 함께 수업/방과후학습/동아리활동 등을 통해 재미있게 배워보세요. - 모든 내용
codeup.kr
답
#include <stdio.h>
int main()
{
char n;
scanf("%c", &n);
for(char i='a'; i<=n; i++)
printf("%c ",i);
return 0;
}
// ---------------------------------
#include <stdio.h>
int main() {
char n, text = 'a';
scanf(" %c", &n);
while(1) {
printf("%c\n", text);
if (n == text) return 0;
text++;
}
}
728x90