http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Lectures&no=8154 [º¹»ç]
#include <stdio.h>
#include <getchar>
int main()
{
int year;
printf("´ëÇб³ µî·Ï±Ý Çг⺰¸ñ·Ï: 1Çгâ, 2Çгâ, 3Çгâ, 4Çгâ \n");
printf("1, 2, 3, 4 Á¤¼ö·Î ÀÔ·ÂÇØÁÖ¼¼¿ä \n");
printf("ÇгâÀ» ÀÔ·ÂÇϼ¼¿ä: ");
scanf("%d", &year); // À§ÀÇ int °ª¿¡ ÀúÀå½Ãŵ´Ï´Ù ex)1 Çгâ
switch(year)
{
case 1: printf("µî·Ï±ÝÀº 130¸¸¿ø ÀÔ´Ï´Ù.\n");
break;
case 2:
case 3: printf("µî·Ï±ÝÀº 100¸¸¿ø ÀÔ´Ï´Ù. \n");
break;
case 4: printf("µî·Ï±ÝÀº 110¸¸¿ø ÀÔ´Ï´Ù. \n");
break; //ÀÌ·±½ÄÀ¸·Î 1ÇгâºÎÅÍ 4ÇгâÀÇ °æ¿ì¸¦ ÀÛ¼ºÇÕ´Ï´Ù
default: printf("ÇгâÀ» À߸ø ÀÔ·ÂÇÏ¿´½À´Ï´Ù. \n");
break; //±×ÀÌ¿ÜÀÇ ¼ýÀÚ¸¦ ÀԷ¹ÞÀ¸¸é ÀÌ·± ¹®ÀÚ°¡ ¶ß°ÔÇÕ´Ï´Ù
}
getchar();
return 0;
} //ÇÁ·Î±×·¥À» ¸¶Ä¨´Ï´Ù
|
Hit : 8028 Date : 2015/09/24 01:16
|