Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[4889] 2년만에 다시시작 할려하는대 도무지 모르겠내요....도와주세요 ㅠ.ㅠ
돗대리아 [dotdea] 1345 읽음    2005-01-21 13:50
몇년동안 접다가 다시 시작할려고 또 시작해 봅니다.

예전에 짜봤던 프로그램을 다시 해보니 안되더군요.

컴파일은 분명히 에러없이 넘었갔는대요. 실행이 안됩니다.

도무지 뭐가 문제인지를 모르겠습니다.

도와주세요... ㅠ.ㅠ

씨 너무 어려워요......

제가짠 프로그램이 무엇이 문제인지 함 봐주세요.....

아님 윈도우에서 지원이 안되는건지......@,.@;


#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;
        }
}

+ -

관련 글 리스트
4889 2년만에 다시시작 할려하는대 도무지 모르겠내요....도와주세요 ㅠ.ㅠ 돗대리아 1345 2005/01/21
4902     메모리 할당 문제입니다... 남병철.레조 1448 2005/02/06
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.