[정올] Language Coder_반복제어문1_자가진단6_code633 (C)

두비니

·

2020. 3. 16. 02:12

 

 

#include <stdio.h>

int main() {
	int a;
	while (1) {
		printf("1. Korea\n2. USA\n3. Japan\n4. China\nnumber? ");
		scanf("%d", &a);
		switch (a) {
		case 1:
			printf("\nSeoul\n\n");
			break;
		case 2:
			printf("\nWashington\n\n");
			break;
		case 3:
			printf("\nTokyo\n\n");
			break;
		case 4:
			printf("\nBeijing\n\n");
			break;
		default:
			printf("\nnone\n\n");
			return 0;
		}
	}
}