http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=850 [º¹»ç]
¼Ò½º°¡ µ¹¾Æ°¡±ä Çϴµ¥ Á¦´ë·Î Àǵµ´ë·Î µ¹¾Æ°¡Áö ¾Ê³×¿ä...
#include <stdio.h>
void main(void)
{
char a;
char b;
char c;
char iwana;
int ca;
int cb;
char d;
do{
printf("\nWelcome to this calculation program.");
printf("\nThis program is Beta ver.");
printf("\nPlease send an e-mail which including bug about program to me.");
printf("\nE-mail add : agape_hatred@naver.com");
printf("\nSelect the first number : ");
scanf("%c", &a);
while(('A'<=a && a<='Z')||('a'<=a && a<='z'))
{
printf("\n[[Warning]]You must select \"number\"[[Warning]]");
printf("\nSelect the first number : ");
scanf("%c", &a);
getchar();
};
getchar();
printf("\nSelect the second number : ");
scanf("%c", &b);
while(('A'<=b && b<='Z')||('a'<=b && b<='z'))
{
printf("\n[[Warning]]You must select \"number\"[[Warning]]");
printf("\nSelect the second number : ");
scanf("%c", &b);
getchar();
};
getchar();
printf("\n[[Operation]] Plus = 1 Minus = 2 Multiplication = 3 Division = 4");
printf("\nSelect the operation : ");
scanf("%c", &c);
getchar();
while((1>c)||(c>4))
{
printf("\n[[Warning]]You must select \"number\"[[Warning]]");
printf("\n[[Operation]] Plus = 1 Minus = 2 Multiplication = 3 Division = 4");
printf("\nSelect the operation : ");
scanf("%c", &c);
getchar();
};
while(c=1)
{
d = a+b;
};
while(c=2)
{
d = a-b;
};
while(c=3)
{
d = a*b;
};
while(c=4)
{
d = a/b;
};
printf("Loading...");
printf("\nAnswer is %c", &d);
printf("Exit = 1 Maintain = 2");
printf("\nDo you want to exit?");
scanf("%c", &iwana);
}while(iwana==2);
}
whileºÎºÐ¿¡¼ ¹®Á¦°¡ ÀÚ²Ù³ª³×¿ä
¿ø·¡ whileºÎºÐÀº ¼ýÀÚ°¡ ¾Æ´Ñ ºÎºÐÀ» ÀԷ¹޾ÒÀ»¶§ °æ°í¸Þ¼¼Áö¿ÍÇÔ²² ´Ù½ÃÇѹø
ÀÔ·ÂÀ» ¹Þµµ·Ï ÇÏ´Â ºÎºÐÀε¥ ¿µ¹®À» µÎ¹øÀÔ·ÂÇϰųª ¾Æ´Ô Á¦´ë·Î ÀÔ·ÂÇصµ ¸¶Áö¸·¿¡
¿¬»êÁ¾·ù¸¦ ÀԷ¹ÞÀ»¶§ Á¦´ë·Î ÀÔ·ÂÇصµ °è¼Ó °æ°í¸Þ¼¼Áö°¡ Ãâ·ÂµÇ¸é¼ ¿¬»ê°úÁ¤À¸·Î ³Ñ¾î°¡Áú ¾Ê³×¿ä ¼Ò½ºÁ» ¼öÁ¤ÇØ ÁÖ¼¼¿ä ¿øÀΰú ÇÔ²² .. °úÇÑ Áú¹®Àΰ¡? |
Hit : 3062 Date : 2005/08/29 07:53
|