몇년동안 접다가 다시 시작할려고 또 시작해 봅니다.
예전에 짜봤던 프로그램을 다시 해보니 안되더군요.
컴파일은 분명히 에러없이 넘었갔는대요. 실행이 안됩니다.
도무지 뭐가 문제인지를 모르겠습니다.
도와주세요... ㅠ.ㅠ
씨 너무 어려워요......
제가짠 프로그램이 무엇이 문제인지 함 봐주세요.....
아님 윈도우에서 지원이 안되는건지......@,.@;
#include <stdio.h>
#include <conio.h>
void main (void)
{
char *ch1,*ch2,*ch3,*ch4,*ch5,*ch6,*ch7,*chs,*che,chf;
int end=1,barf=1,i;
float value1=0,value2=0,total=0;
clrscr ();
ch1="First value input";
ch2="Next value input";
ch3-"Calculation function input";
ch4="Not input calculation function";
ch5="No error";
ch6="Welcome";
ch7="Bye bye";
f_1:
while(end!=0){
if(barf==1){
value1=value2=total=0;
chs=ch6; /* status "welcome" */
che=ch5; /* error "no error" */
chf=' '; /* function */
}
if(barf==2){
chs=ch1; /* status "first value input" */
}
if(barf==3){
scanf("%f",&value1);
chs=ch3; /* function "calculation function input" */
}
if(barf==4||barf==9){
chf=getch();
chs=ch2; /* status "next value input" */
}
}
while(barf==5){
scanf("%f",&value2);
switch(chf){
case'+':total=value1+value2;
chs=ch3;
barf=3;
break;
case'-':total=value1-value2;
chs=ch3;
barf=3;
break;
case'*':total=value1*value2;
chs=ch3;
barf=3;
break;
case'/':total=value1/value2;
chs=ch3;
barf=3;
break;
case'c':value1=value2=total=0;
barf=1;
break;
case'e':end=0;
chs=che=ch7;
goto f_1;
default:che=ch4; /* error "not input calculation function" */
value2=0;
barf=7;
break;
}
}
printf( "___________________________________________\n");
printf("| This program is \CALCULATOR\". |\n");
printf("| Program by (2002.12.18~2002.12.22) |\n");
printf("|===========================================|\n");
printf(" %f%c%f=%f \n,value1,chf,value2,total" );
printf("|===========================================|\n");
printf("| |\n");
printf("| --- --- --- --- --- |\n");
printf("| | 7 | | 8 | | 9 | | + | | - | |\n");
printf("| --- --- --- --- --- |\n");
printf("| --- --- --- --- --- |\n");
printf("| | 4 | | 5 | | 6 | | * | | / | |\n");
printf("| --- --- --- --- --- |\n");
printf("| --- --- --- --- --- |\n");
printf("| | 1 | | 2 | | 3 | |Ext| |Cle| |\n");
printf("| --- --- --- --- --- |\n");
printf("| --- --- --- --- --- |\n");
printf("| |Mem| | 0 | |Lod| |Del| | ? | |\n");
printf("| --- --- --- --- --- |\n");
printf("| |\m");
printf("|===========================================|\n");
printf(" Status : %s \n",chs);
printf("|===========================================|\n");
printf(" Error : %s \n",che);
printf("|===========================================|\n");
printf("| Mem = data memory, Lod = memory load |\n");
printf("| Cle = data clear, Del = memory data clear|\n");
printf("| Ext = prigram exit, ? = 미정 |\n");
printf("|___________________________________________|\n");
barf++;
if(barf==6){
value1=total;
barf=3;
}
if(barf==8){
chs=ch3; /* function "calculation function input */
barf=9;
}
if(barf>9){
clrscr ();
printf("Program Error\n\n\n\n");
printf("Press\"R\"key to\"NEW START\"\n");
printf("Press\"E\"key or any key to \"EXIT\n");
if(getch()=='r')end=1;
else end=0;
barf=1;
clrscr();
goto f_1;
}
}
|