#include<stdio.h>
#include<Windows.h>
int main(void)
{
double operand1,operand2,result;
char selected_operator;
int retry;
do
{
retry=0;
printf("원하시는 계산을 적으십시오.\n");
scanf("%lf%c%lf",&operand1,&selected_operator,&operand2);
if(selected_operator==43)
result=operand1+operand2;
else if(selected_operator==45)
result=operand1-operand2;
else if(selected_operator==42)
result=operand1*operand2;
else if(selected_operator==47)
result=operand1/operand2;
else
{
printf("잘못입력하셨습니다\n");
retry=1;
}
}while(retry==1);
printf("%g %c %g = %f\n",operand1,selected_operator,operand2,result);
printf("안녕히가십시오\n");
system("pause");
return 0;
}
win32 노사용이다에요? 헤더하나불필요? - DCW
도유 코토 데스까?
scanf printf system 전부 씨표준라이브러리다에요? windows.h 인클루드 불필요하다에요? - DCW
대신 stdlib.h 필요타에요? - DCW
ㄴ그렇구만 아리가또 근데 ?붙이는거 컨셉 데스까?
비밀이다에요? O.< - DCW
http://dblack.tk
커뮤니티 사이트 입니다 많은 이용 부탁 드립니다.