[자료구조]Infix로 된 수식을 Prefix와 Postfix로 변환 시키는 프로그램입니다.(C언어)
본 자료는 5페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
해당 자료는 5페이지 까지만 미리보기를 제공합니다.
5페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[자료구조]Infix로 된 수식을 Prefix와 Postfix로 변환 시키는 프로그램입니다.(C언어)에 대한 보고서 자료입니다.

목차

1. Source Code ( hw8.c ) -3 -

2. 실행 화명
Error 검사(1) - 14 -
Error 검사(2) - 15 -

3. hw8.out ( 실행 결과 ) - 16 -

본문내용

tf(fp,"%d",top->data - MAX_ASCII);
}
else if ( top->data > 47 ){// 숫자가 아닌 operand인 경우.
printf("%c",top->data);
fprintf(fp,"%c",top->data);
}
else print_token( top->data );// 나머지 경우.
top = top->link;
}
}
stack_ptr invert ( stack_ptr lead ){ // invert stack
stack_ptr middle, trail;
middle = NULL;
while ( lead ){
trail = middle;
middle = lead;
lead = lead->link;
middle->link = trail;
}
return middle;
}
int Stack_Size(stack_ptr strp){ // get stack size
int size=0;
stack_ptr temp = strp;
for ( ; strp ; strp = strp->link ){
size++;
}
strp = temp;
return size;
}
♣ 실행 화면
1. Error 검사(1)
2. Error 검사(2)
♣ hw8.out
--------------------------------------------------------
Welcome to Change Infix to Prefix and Postfix Program.
--------------------------------------------------------
Input infix numerical formula
: ((((a/b)-c+(d*e))-(a*c))
Get Input Ok...
Lparen more than Rparen, miss match parens..
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: ((((10/2)-1)+(32*2))-(13*11))
Get Input Ok...
Postfix : 102/1-322*+1311*-
Prefix : -+-/1021*322*1311
evaluation of input : -75
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: a+b*d-w/t%s
Get Input Ok...
Postfix : abd*+wt/s%-
Prefix : -+a*bd%/wts
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: (a+b)*e-x/g
Get Input Ok...
Postfix : ab+e*xg/-
Prefix : -*+abe/xg
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: ((a+b)-d)+d*e
Get Input Ok...
Postfix : ab+d-de*+
Prefix : +-+abd*de
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: ((a+d)*w-(c-w))+((d+e)*w-(d-s))
Get Input Ok...
Postfix : ad+w*cw--de+w*ds--+
Prefix : +-*+adw-cw-*+dew-ds
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: 1+2*3+7%2
Get Input Ok...
Postfix : 123*+72%+
Prefix : ++1*23%72
evaluation of input : 8
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: ((10+3)*2)-5*4
Get Input Ok...
Postfix : 103+2*54*-
Prefix : -*+1032*54
evaluation of input : 6
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: (13+4)*3+((43+32)*12)
Get Input Ok...
Postfix : 134+3*4332+12*+
Prefix : +*+1343*+433212
evaluation of input : 951
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Input infix numerical formula
: (10*320)%12+(122/2)*2
Get Input Ok...
Postfix : 10320*12%1222/2*+
Prefix : +%*1032012*/12222
evaluation of input : 130
Press 'q' key to quit.
Press 'h' key to see Input Grammer
Press any other key to contiue.
Goodbye and thanks for using this software

키워드

자료구조,   data structure,   infix,   posfix,   prefix,   source code,   C
  • 가격2,000
  • 페이지수16페이지
  • 등록일2006.11.26
  • 저작시기2002.10
  • 파일형식한글(hwp)
  • 자료번호#377491
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니