계산기 말입니다.
콩쑨
제가 계산기를 하나 만들고 있는데요/
무한 반복문을 이용해서 마지막에
다시 하시겠습니까? y/n으로 해서 다시돌아 갈수 있도록 했으면 좋겠습니다.
직접 소스를 작성해주시면 감사하겠습니다.
#includestdio.h
#includeconio.h
#includestring.h
#includeWindows.h
int main()
{
int a,b;
int res;
printf( AC Tools Build 2700 V.2.0\n\n);
printf(\n\n\n 하시고 싶은 연산을 골라주세요 1.덧셈 2.뺄셈 3.곱셈 4.나눗셈);
scanf(%d , &res);
switch(res){
case 1:
system(cls);
printf( \n\n\n\n 더하고 싶은 수들 중에서 첫번째 수를 입력해 주세요 :);
scanf(%d ,&a);
printf(\n\n\n\n 더하고 싶은 수들 중에서 두번째 수를 입력해 주세요: );
scanf(%d , &b);
system(cls);
printf(\n\n\n\n\n\n 처음 입력하신 숫자는 %d 이고, \n 두번째 입력하신 숫자의 값은 %d 이므로, \n 두수를 더하면 %d가 됩니다\n : ,a,b , a+b);
printf(\n\n\n Version 2.0, \n powered by Rs Soft Corporation );
getch();
return 0;
case 2:
system(cls);
printf(\n\n\n\n빼고 싶은 수들중에, 처음수를 입력해주세요 :);
scanf(%d , &a);
printf(\n\n\n\n\n빼고 싶은 수들중에, 두번쨰 수를 입력해주세요 :);
scanf(%d , &b);
system(cls);
printf(\n\n\n\n\n\n\n\n\n\n\n뺼샘 결과 처음 입력한 건 %d이고, \n두번째 입력한 것은 %d이므로, \n두수를 뺴면 %d가 됩니다\n,a,b, a-b);
printf(\n\n\n Version 2.0, \n powered by Rs Soft Corporation );
getch();
return 0;
case 3:
system(cls);
printf(\n\n\n\n곱하고 싶은 수들중에, 처음 수를 입력해 주세요 :);
scanf(%d, &a);
printf(\n\n\n\n\n곱하고 싶은 수들중에, 두번째 수를 입력해주세요 :);
scanf(%d, &b);
system(cls);
printf(\n\n\n\n\n\n\n\n\n\n\n곱셈 결과 처음 입력한 것은 %d이고, \n두번쨰 입력한 것은 %d이므로, \n 두수를 곱하면 %d가 됩니다\n,a,b, a*b);
printf(\n\n\n Version 2.0, \n powered by Rs Soft Corporation );
getch();
return 0;
case 4:
system(cls);
printf(\n\n\n\n나누고 싶은 수들중에, 첫번째 수를 입력해주세요:);
scanf(%d , &a);
printf(\n\n\n\n\n나누고 싶은 수들중에, 두번째 수를 입력해주세요:);
scanf(%d , &b);
system(cls);
printf(\n\n\n\n\n\n\n\n나눗셈 결과 처음입력한건 %d이고, \n두번째 입력한 것은 %d이므로, \n두수를 나누면 %d가 됩니다\n,a,b, a/b);
printf(\n\n\n Version 2.0, \n powered by Rs Soft Corporation );
getch();
return 0;
}
}
-
조심해 2024-01-25
음...전 XP pro에 VS6.0 버젼인데..몇번을 해도 오류 안나오네요..ㅎㅎ
-
불꾼 2024-01-25
음..
운영체제 차이인가요??
전 Windows7 Ultimate K입니다만.. -
호습다 2024-01-25
음..전 오류가 나지 않는데 말이죠...음