0001 #include "nest_stack/nest.h" 0002 0003 /****************************************************************************************** 0004 * 显示表达式片段exp[lo, hi],与原表达式对齐 0005 ******************************************************************************************/ 0006 void displaySubstring ( const char exp[], Rank lo, Rank hi ) { 0007 for ( Rank i = 0; i < lo; i++ ) printf ( " " ); 0008 for ( Rank i = lo; i <= hi; i++ ) printf ( "%c", exp[i] ); 0009 printf ( "\n" ); 0010 } 0011 0012 /****************************************************************************************** 0013 * 显示表达式扫描进度 0014 ******************************************************************************************/ 0015 void displayProgress ( const char exp[], Rank i, Stack<char> S ) { 0016 // 表达式 0017 system ( "cls" ); 0018 printf ( "\n%s\n", exp ); 0019 for ( Rank j = 0; j < i; j++ ) printf ( "-" ); 0020 printf ( "^\n\n\n" ); 0021 // 栈 0022 print ( S ); getchar(); 0023 }