c언어 네이버

언어/c언어2017. 12. 19. 20:49

http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040101&docId=290640931

# include <stdio.h>


int main(void) {

char alpha = '\0'; // Initillize

while (1) {

printf("Lower case input:  ");

alpha = getch();

fflush(stdout); // stack 비우기

if (!((int)alpha >= 97 && (int)alpha <= 122)) {

if ((int)alpha == 27) { // (int)("ESC") == 27

break;

}

else {

puts("잘못입력하셨습니다.");

}

}

else {

printf("%c\n", (int)alpha-32);

}

}

return 0;

}

'언어 > c언어' 카테고리의 다른 글

c언어 - 시저암호  (0) 2018.01.04
유의 할것 strcmp  (0) 2017.12.23
풀이 네이버  (0) 2017.12.18
Bubble_ Select_ Sort  (0) 2017.12.16
합집합  (0) 2017.12.14