/알고리즘 문제풀이 전략 1-1.c Secret
Last active
August 18, 2017 15:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void main() | |
{ | |
char key; | |
int data; | |
printf("10진수 --> 16진수로 변환하는 프로그램이다. \n"); | |
printf("10진수를 16진수로 바꾸려변 [A] 키를 누르고, \n"); | |
printf("16진수를 19진수로 바꾸려변 [B] 키를 누르세요. \n"); | |
printf("a나 b를 누르세요 : "); | |
scanf("%c", &key); | |
printf("변환할 숫자를 입력하세요 : "); | |
if (key == 'a') { | |
scanf("%d", &data); | |
printf("10진수 값 : %d --> 16진수 값 : %x", data, data); | |
} | |
else if(key == 'b') { | |
scanf("%d", &data); | |
printf("10진수 값 : %d --> 16진수 값 : %x", data, data); | |
} | |
else { | |
printf("A나 B를 입력해 주세요"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment