本文介绍了while循环不适用于多条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这里是更新的代码,但仍无法正常工作...... #include< stdio.h> < pre> #include< stdio.h> #include< conio.h> #include< iostream> #include< string.h> #include< stdlib.h>使用namespace std ; void tokenization(void); FILE * vl; char inputstring [100]; int index = 0; int line = 1; char sep [] = {32,'(',')',',',';','{','}','[',']','+',' - , '=', '/', '\\\', '\0', '^', '*', '和;!', '|', '#', ''}; void main(void) { vl = fopen(input.txt,r); int rf; rf = getc(vl); while(rf!= EOF) { inputstring [index ++] = rf; rf = getc(vl); } inputstring [index] ='\0'; fclose(vl); puts(代码:); puts(inputstring); printf(\ nn \ n); tokenization(); getche(); } void tokenization() { int i = 0; char token [100]; int j = 0; bool check = false; do { if(inputstring [i] =='\ n') line ++; while((inputstring [i] == 32&& inputstring [i]!='\ 0')|| inputstring [i] =='\ n') i ++; switch(inputstring [i]) { case'{': printf(\ nValue Part:{\tClass Part:c_br_open \ tt \ tline =%d,线); check = true; i ++; 休息; case'}': printf(\ nValue Part:} \tClass Part:c_br_close \t\tLine =%d,line); check = true; i ++; 休息; case'(': printf(\ nValue Part:(\ t \tClass Part:r_br_open \t \tLine =%d,line); check = true; i ++; break; case')': printf(\ nValue Part:)\ tClass Part:r_br_close \ t\tLine = %d,线); check = true; i ++; 休息; case'[': printf(\ nValue Part:[\ tClass Part:sq_br_open \t \tLine =%d,line); check = true; i ++; 休息; case']': printf(\ nValue Part:)\ tClass Part:sq_br_close \tt \tLine =%d,line); check = true; i ++; 休息; case';': printf(\ nValue Part:; \\%{d}行,行); check = true; i ++; 休息; case':': printf(\ nValue Part :::\ tClass Part:Colon\t\tLine =%d,line); check = true; i ++; 休息; case'@': printf(\ nValue Part:@ \\\ Error at line%d,line); check = true; i ++; 休息; case'#': printf(\ nValue Part:在行%d处的#\\\错误,行); check = true; i ++; 休息; case'。': printf(\ nValue Part:。\ tClass Part:Dot \t\tLine =%d,line); check = true; i ++; 休息; case'^': printf(\ nValue Part:^ \tClass Part:MDPOperators\t\tLine =%d,line); check = true; i ++; 休息; case'*': printf(\ nValue Part:* \tClass Part:MDPOperators \t\tLine =%d,line); check = true; i ++; 休息; case'<': i ++; if(inputstring [i] =='=') { printf(\ nValue Part:< = \tClass Part:RelOperators \t\tLine =% d,线); check = true; i ++; 休息; } else { printf(\ nValue Part:< \tClass Part:RelOperators\t\tLine =%d,line); check = true; 休息; } case'>': i ++; if(inputstring [i] =='=') { printf(\ nValue Part:> = \tClass Part:RelOperators\t\LLine =% d,线); check = true; i ++; 休息; } else { printf(\ nValue Part:> \tClass Part:RelOperators\t\tLine =%d,line); check = true; 休息; } case'!': i ++; if(inputstring [i] =='=') { printf(\ nValue Part:!= \tClass Part:RelOperators\t\LLine =%d ,线); check = true; i ++; 休息; } 其他 { printf(\ nValue Part:!,\tClass Part:Not\t\tLine =%d,线); check = true; 休息; } case',': printf(\ nValue Part:,\tClass Part:Comma\t\tLine =%d,line); check = true; i ++; 休息; case'+': printf(\ nValue Part:+ \t\tClass Part:A_SOperators\t\tLine =%d,line); check = true; i ++; 休息; case' - ': printf(\ nValue Part:-\t\tClass Part:A_SOperators\t\tLine =%d,line); check = true; i ++; 休息; case'=': printf(\ nValue Part:= \tClass Part:AsgOperator\t\tLine =%d,line); check = true; i ++; 休息; case'|': i ++; if(inputstring [i] =='|') { printf(\ nValue Part:|| \tClass Part:RelOperators \t\LLine =%d ,线); check = true; i ++; 休息; } 其他 { printf(行号%d处的\ nError,行); 休息; } case'$': printf(\ nValue Part:,\tClass Part:OR\t\tLine =%d,line); check = true; i ++; 休息; case'&': printf(\ nValue Part:,\ tClass Part:And\tLine =%d,line); check = true; i ++; 休息; case'/': i ++; if(inputstring [i] =='>') { printf(\ nValue Part:/> \ tClass Part:Terminator \tLine =%d ,线); check = true; i ++; 休息; } else { printf(\ nValue Part:/ \tClass Part:MDPOperators\tLine =%d,line); check = true; i ++; line ++; 休息; } case'%': if(inputstring [i] =='%') { i ++; do { inputstring [i ++]; } while(inputstring [i]!='%'); check = true; i ++; } 默认值: break; } if(check == false) { if(inputstring [i] =='\'') { i + 2; if(inputstring [i] =='\'') { printf(\t\tClass part:Char constant\t); i ++; 休息; } 其他 { printf(错误); i ++; 休息; } } if(inputstring [i] =='') { i ++; do { token [j ++] = inputstring [i ++]; } while(inputstring [i]!=''); token [j] ='\0'; check = true; i ++; printf(\ nValue Part:); for(int k = 0; k< strlen(token); k ++) putchar(token [k]); printf(\t\tClass Part:STRING\t\tLine:%d,line); } } if(check == false) { / * while(inputstring [i]!= 32 || inputstring [i]!=' ('|| inputstring [i]!=')'|| inputstring [i]!=','|| inputstring [i]!=';'|| inputstring [i]!='{' || inputstring [I]!= '}' || inputstring [I]!= '[' || inputstring [I]!= ']' || inputstring [I]!= '+' || inputstring [I] !=' - '|| inputstring [i]!='='|| inputstring [i]!='/' || inputstring [i]!='\ n'|| inputstring [i] != '\0' || inputstring [I] = '^' || inputstring [I] = '*' || inputstring [I] = '&安培;'!!|| inputstring [I] = |' || inputstring [i]!='#'|| inputstring [i]!='!')* / for(int k = 0; k< 20; k ++) { while(inputstring [i]!= sep [k]) { if(inputstring [i]!='\ 0') { token [j ++] = inputstring [i ++]; // check = true; 休息; // k ++; } 其他休息; } 休息; } token [j] ='\0'; switch(token [0]) { case'f': if(token [1] =='n'&& token [2] == 'u'&& token [3] =='m') { printf(\ nValue Part:fnum \tClass Part:Datatype \tLine:%d,line ); check = true; 休息; } if(token [1] =='a'&& token [2] =='l'&& token [3] =='s'&& token [4] =='e') { printf(\ nValue Part:false \tClass Part:TF\tLine:%d,line); check = true; 休息; } if(token [1] =='o'&& token [2] =='r') { printf(\ nValue Part :for\tClass Part:For\LLine:%d,line); check = true; 休息; } case't': if(token [1] =='r'&& token [2] =='u'&& token [3] =='e') { printf(\ nValue Part:true \tClass Part:TF\tLine:%d,line); check = true; 休息; } case'b': if(token [1] =='r'&& token [2] =='e'&& token [3] =='a'&& token [4] =='k') { printf(\ nValue Part:break \tClass Part:break \tLine:%d ,线); check = true; 休息; } if(token [1] =='o'&& token [2] =='o'&& token [3] =='l') { printf(\ nValue Part:bool\tClass Part:bool\tLine:%d,line); check = true; 休息; } case'w': if(token [1] =='h'&& token [2] =='i'&& token [3] =='l'&& token [4] =='e') { printf(\ nValue Part:while\tClass Part:while\tLine:%d ,线); check = true; 休息; } case'v': if(token [1] =='o'&& token [2] =='i'&& token [3] =='d') { printf(\ nValue Part:void\tClass Part:void\tLine:%d,line); check = true; 休息; } case'm': if(token [1] =='a'&& token [2] =='i'&& token [3] =='n') { printf(\ nValue Part:main \tClass Part:main \tline%d,line); check = true; 休息; } case'e': if(token [1] =='l'&& token [2] =='s'&& token [3] =='e') { printf(\ nValue Part:else \tClass Part:else \tline%d,line); check = true; 休息; } case'c': if(token [1] =='a'&& token [2] =='s'&& token [3] =='e') { printf(\ nValue Part:case\tClass Part:case\tline%d,line); check = true; 休息; } if(token [1] =='o'&& token [2] =='n'&& token [3] =='t'&& token [4] =='i'&& token [5] =='n'&& token [6] =='u'&& token [7] =='e') { printf(\ nValue Part:continue \tClass Part:continue \t line%d,line); check = true; 休息; } case'l': if(token [1] =='n'&& token [2] =='u'&& token [3] =='m') { printf(\ nValue Part:lnum \tClass Part:Datatype \tline%d,line); check = true; 休息; } 案例'd': if(token [1] =='e'&& token [2] =='f'&& token [3] =='a'&& token [4] =='u'&& token [5] =='l'&& token [6] =='t') { printf(\ nValue Part:default \tClass Part:Default\tline%d,line); check = true; 休息; } case's': if(token [1] =='n'&& token [2] =='u'&& token [3] =='m') { printf(\ nValue Part:snum \tClass Part:Datatype \tline%d,line); check = true; 休息; } if(token [1] =='w'&& token [2] =='i'&& token [3] =='t'&& token [4] =='c'&& token [5] =='h') { printf(\ nValue Part:switch \tClass Part:Switch \ tline %d,线); check = true; 休息; } if(token [1] =='t'&& token [2] =='r') { if(token [3] = ='i'&& token [4] =='n'&& token [5] =='g') { printf(\ nValue Part:string \\ \\ tClass类:数据类型\tLine%d,行); check = true; 休息; } if(token [3] =='u'&& token [4] =='c'&& token [5] =='t') { printf(\ nValue Part:struct\tClass Part:Struct\tLine%d,line); check = true; 休息; } } 案例'i': if(token [1] =='f') { printf(\ nValue Part:if\tClass Part:If\tLine%d,line); check = true; 休息; } 案例'a': if(token [1] =='l'&& token [2] =='p'&& token [3] =='h'&& token [4] =='a') { printf(\ nValue Part:alpha \tClass Part:Datatype \tLine%d,线); check = true; 休息; } case'n': if(token [1] =='u'&& token [2] =='m') { printf(\\\Value Part :: num \tClass Part:Datatype \tLine%d,line); check = true; 休息; } 案例'r': if(token [1] =='e') { if(token [2] =='t' && token [3] =='u'&& token [4] =='r'&& token [5] =='n') { printf (\\\ValuePart :: return \tClass Part:Return \tLine%d,line); check = true; 休息; } if(token [2] =='p'&& token [3] =='e'&& token [4] =='a'&& token [5] =='t') { printf(\\\ ValuePart :: repeat\tClass Part:Repeat \t line:%d,line); check = true; 休息; } } case'g': if(token [1] =='o'&& token [2] =='t '&& token [3] =='o') { printf(\ nValue Part:goto \tClass Part:Goto \t line:%d,line) ; check = true; 休息; } 默认值: break; } } if(check == false) { j = 0; while(token [j]!='\ 0') { if(token [j]< 58&& token [j]> 47) j ++; 其他休息; } if(token [j] =='\ 0') { printf(\ nValue Part:); for(int k = 0; k< strlen(token); k ++) putchar(token [k]); printf(\t\tClass Part:Num_const \t \tLine:%d,line); } j = 0; if((token [j]> 64&& token [j]< 91)||(token [j]> 96&& token [j]< 123)|| token [ j] =='_') { j ++; while(token [j]!='\ 0') if((token [j]> 64&& token [j]< 91)||(token [j] > 96&& token [j]< 123)|| token [j] =='_'||(token [j]< 58&& token [j]> 47)) j ++; 其他休息; } if(token [j] =='\ 0') { printf(\ nValue Part:); for(int k = 0; k< strlen(token); k ++) putchar(token [k]); printf(\t\tClass Part:ID\t\tLine:%d,line); } } check = false; J = 0; } while(inputstring [i]!='\ 0'); printf(\ nValue Part:EOF \t\tClass Part:EOF); } 第三个最后一个循环不能正常工作它通过char分隔char而不是逐字逐句解决方案 让我们通过消除内部while循环来清除这种混乱。 if (inputstring [i] == ' \ n') line ++; while ((inputstring [i] == 32&& inputstring [i]!= ' \0')|| inputstring [i] == ' \ n') i ++; 开关(inputstring [i]) 试一试... 开关(inputstring [i]) { case 0 : 破; case ' \ n': line ++; i ++; break ; case ' \t': case ' ': i ++; break ; 代码应该更容易阅读。这将跳过制表符和空格。 你的for循环检查分隔符列表是没有意义的,因为你已经在交换机中查找分隔符字符声明。 考虑添加一个状态变量。状态变量将告诉您当前正在扫描或累积的令牌。当你在代币之间时,包括一个开放的或未决定的状态。 个人(我不想这样说),但我会通过角色方法废弃这个角色使用左匹配递归下降方法进行标记化。 以SAX速度解析XML而不使用DOM或SAX [ ^ ] 上面的文章包括用于执行左匹配正向解析的代码,允许您编写类似的代码... if (parseMatch(cursor, while)) token = TOKEN_WHILE; else if (skipspace(cursor)) token = TOKEN_SPACE; else if (parseMatch(cursor, {)) token = TOKEN_OPENBRACE 本文包含C ++代码,但这些想法很容易转换为C。 Here the updated code but still its not working....#include<stdio.h><pre>#include<stdio.h>#include<conio.h>#include<iostream>#include<string.h>#include<stdlib.h>using namespace std;void tokenization(void);FILE *vl;char inputstring[100];int index=0;int line = 1;char sep[]={32,'(',')',',',';','{','}','[',']','+','-','=','/','\n','\0','^','*','&','|','#','!'};void main(void){vl=fopen("input.txt","r");int rf;rf = getc(vl);while(rf!=EOF){inputstring[index++]=rf;rf=getc(vl);}inputstring[index]='\0';fclose(vl);puts("Code:");puts(inputstring);printf("\n\n");tokenization();getche();}void tokenization(){int i=0;char token[100];int j=0;bool check = false;do{if(inputstring[i]=='\n')line++;while ((inputstring[i]==32&&inputstring[i]!='\0')||inputstring[i]=='\n')i++;switch (inputstring[i]){case '{' :printf("\nValue Part : {\tClass Part : c_br_open\t\tLine=%d",line);check=true;i++;break;case '}' :printf("\nValue Part : }\tClass Part : c_br_close\t\tLine=%d",line);check=true;i++;break;case '(' :printf("\nValue Part : (\t\tClass Part : r_br_open\t\tLine=%d",line);check=true;i++;break;case ')' :printf("\nValue Part : )\tClass Part : r_br_close\t\tLine=%d",line);check=true;i++;break;case '[' :printf("\nValue Part : [\tClass Part : sq_br_open\t\tLine=%d",line);check=true;i++;break;case ']' :printf("\nValue Part : )\tClass Part : sq_br_close\t\tLine=%d",line);check=true;i++;break;case ';' :printf("\nValue Part : ;\tError at line %d",line);check=true;i++;break;case ':' :printf("\nValue Part : :\tClass Part : Colon\t\tLine=%d",line);check=true;i++;break;case '@' :printf("\nValue Part : @\tError at line %d",line);check=true;i++;break;case '#' :printf("\nValue Part : #\tError at line %d",line);check=true;i++;break;case '.' :printf("\nValue Part : .\tClass Part : Dot\t\tLine=%d",line);check=true;i++;break;case '^' :printf("\nValue Part : ^\tClass Part : MDPOperators\t\tLine=%d",line);check=true;i++;break;case '*' :printf("\nValue Part : *\tClass Part : MDPOperators\t\tLine=%d",line);check=true;i++;break;case '<':i++;if (inputstring[i]=='='){printf("\nValue Part : <=\tClass Part : RelOperators\t\tLine=%d",line);check=true;i++;break;}else{printf("\nValue Part :< \tClass Part :RelOperators\t\tLine=%d",line);check=true;break;}case'>':i++;if (inputstring[i]=='='){printf("\nValue Part :>=\tClass Part : RelOperators\t\tLine=%d",line);check=true;i++;break;}else{printf("\nValue Part :>\tClass Part :RelOperators\t\tLine=%d",line);check=true;break;}case '!':i++;if (inputstring[i]=='='){printf("\nValue Part : !=\tClass Part : RelOperators\t\tLine=%d",line);check=true;i++;break;}else{printf("\nValue Part :!,\tClass Part : Not\t\tLine=%d",line);check=true;break;}case ',' :printf("\nValue Part : ,\tClass Part : Comma\t\tLine=%d",line);check=true;i++;break;case '+' :printf("\nValue Part :+\t\tClass Part : A_SOperators\t\tLine=%d",line);check=true;i++;break;case '-' :printf("\nValue Part:-\t\tClass Part : A_SOperators\t\tLine=%d",line);check=true;i++;break;case '=' :printf("\nValue Part : =\tClass Part : AsgOperator\t\tLine=%d",line);check=true;i++;break;case '|':i++;if (inputstring[i]=='|'){printf("\nValue Part : ||\tClass Part : RelOperators\t\tLine=%d",line);check=true;i++;break;}else{printf("\nError at line %d",line);break;}case '$' :printf("\nValue Part : ,\tClass Part : OR\t\tLine=%d",line);check=true;i++;break;case '&' :printf("\nValue Part : ,\tClass Part : And\tLine=%d",line);check=true;i++;break;case '/':i++;if (inputstring[i]=='>'){printf("\nValue Part : />\tClass Part : Terminator\tLine=%d",line);check=true;i++;break;}else{printf("\nValue Part :/\tClass Part : MDPOperators\tLine=%d",line);check=true;i++;line++;break;}case '%' :if(inputstring[i]=='%'){i++;do{ inputstring[i++];} while (inputstring[i]!='%');check =true;i++;}default:break;}if(check==false){if (inputstring[i]=='\''){i+2;if(inputstring[i] == '\''){printf("\t\tClass part : Char constant\t ");i++;break;}else{printf("Error");i++;break;}}if(inputstring[i]=='"'){i++;do{token[j++]=inputstring[i++];} while (inputstring[i]!='"');token[j]='\0';check =true;i++;printf("\nValue Part : ");for(int k=0;k<strlen(token);k++) putchar(token[k]);printf("\t\tClass Part : STRING\t\tLine:%d",line);}}if(check==false){/*while(inputstring[i]!=32||inputstring[i]!='('||inputstring[i]!=')'||inputstring[i]!=','||inputstring[i]!=';'||inputstring[i]!='{'||inputstring[i]!='}'||inputstring[i]!='['||inputstring[i]!=']'||inputstring[i]!='+'||inputstring[i]!='-'||inputstring[i]!='='||inputstring[i]!='/'||inputstring[i]!='\n'||inputstring[i]!='\0'||inputstring[i]!='^'||inputstring[i]!='*'||inputstring[i]!='&'||inputstring[i]!='|'||inputstring[i]!='#'||inputstring[i]!='!')*/for(int k=0;k<20;k++){while(inputstring[i] != sep[k]){if(inputstring[i]!='\0'){token[j++]=inputstring[i++];//check=true;break;//k++;}elsebreak;}break;}token[j]='\0';switch(token[0]){case 'f':if(token[1]=='n'&&token[2]=='u'&&token[3]=='m'){printf("\nValue Part : fnum\tClass Part : Datatype\tLine: %d",line);check=true;break;}if(token[1]=='a'&&token[2]=='l'&&token[3]=='s'&&token[4]=='e'){printf("\nValue Part : false\tClass Part :TF\tLine: %d",line);check=true;break;}if(token[1]=='o'&&token[2]=='r'){printf("\nValue Part : for\tClass Part :For\tLine: %d",line);check=true;break;}case't':if(token[1]=='r'&&token[2]=='u'&&token[3]=='e'){printf("\nValue Part : true\tClass Part :TF\tLine: %d",line);check=true;break;}case'b':if(token[1]=='r'&&token[2]=='e'&&token[3]=='a'&&token[4]=='k'){printf("\nValue Part : break\tClass Part :break\tLine: %d",line);check=true;break;}if(token[1]=='o'&&token[2]=='o'&&token[3]=='l'){printf("\nValue Part : bool\tClass Part :bool\tLine: %d",line);check=true;break;}case'w':if(token[1]=='h'&&token[2]=='i'&&token[3]=='l'&&token[4]=='e'){printf("\nValue Part : while\tClass Part :while\tLine: %d",line);check=true;break;}case'v':if(token[1]=='o'&&token[2]=='i'&&token[3]=='d'){printf("\nValue Part : void\tClass Part :void\tLine: %d",line);check=true;break;}case'm':if(token[1]=='a'&&token[2]=='i'&&token[3]=='n'){printf("\nValue Part : main\tClass Part :main\tline %d",line);check=true;break;}case'e':if(token[1]=='l'&&token[2]=='s'&&token[3]=='e'){printf("\nValue Part : else\tClass Part :else\tline %d",line);check=true;break;}case'c':if(token[1]=='a'&&token[2]=='s'&&token[3]=='e'){printf("\nValue Part : case\tClass Part :case\tline %d",line);check=true;break;}if(token[1]=='o'&&token[2]=='n'&&token[3]=='t'&&token[4]=='i'&&token[5]=='n'&&token[6]=='u'&&token[7]=='e'){printf("\nValue Part : continue\tClass Part :continue\t line %d",line);check=true;break;}case 'l':if(token[1]=='n'&&token[2]=='u'&&token[3]=='m'){printf("\nValue Part : lnum\tClass Part : Datatype\tline %d",line);check=true;break;}case 'd':if(token[1]=='e'&&token[2]=='f'&&token[3]=='a'&&token[4]=='u'&&token[5]=='l'&&token[6]=='t'){printf("\nValue Part : default\tClass Part : Default\tline%d",line);check=true;break;}case 's':if(token[1]=='n'&&token[2]=='u'&&token[3]=='m'){printf("\nValue Part : snum\tClass Part : Datatype\tline %d",line);check=true;break;}if(token[1]=='w'&&token[2]=='i'&&token[3]=='t'&&token[4]=='c'&&token[5]=='h'){printf("\nValue Part : switch\tClass Part : Switch\tline %d",line);check=true;break;}if (token[1]=='t' && token[2]=='r'){if(token[3]=='i'&&token[4]=='n'&&token[5]=='g'){printf("\nValue Part : string\tClass Part : Datatype\tLine %d",line);check=true;break;}if(token[3]=='u'&&token[4]=='c'&&token[5]=='t'){printf("\nValue Part : struct\tClass Part : Struct\tLine %d",line);check=true;break;}}case 'i':if(token[1]=='f'){printf("\nValue Part : if\tClass Part : If\tLine%d",line);check=true;break;}case 'a':if(token[1]=='l'&&token[2]=='p'&&token[3]=='h'&&token[4]=='a'){printf("\nValue Part : alpha\tClass Part : Datatype\tLine %d",line);check=true;break;}case 'n':if(token[1]=='u'&&token[2]=='m'){printf("\ntValue Part: : num\tClass Part : Datatype\tLine%d",line);check=true;break;}case 'r':if(token[1]=='e'){if(token[2]=='t'&&token[3]=='u'&&token[4]=='r'&&token[5]=='n'){printf("\ntValuePart: : return\tClass Part : Return\tLine%d",line);check=true;break;}if(token[2]=='p'&&token[3]=='e'&&token[4]=='a'&&token[5]=='t'){printf("\ntValuePart: : repeat\tClass Part : Repeat\t line : %d",line);check=true;break;}}case 'g':if(token[1]=='o'&&token[2]=='t'&&token[3]=='o'){printf("\nValue Part : goto\tClass Part : Goto\t line : %d",line);check=true;break;}default :break;}}if(check==false){j=0;while(token[j]!='\0'){if(token[j]<58&&token[j]>47)j++;else break;}if(token[j]=='\0'){printf("\nValue Part : ");for(int k=0;k<strlen(token);k++)putchar(token[k]);printf("\t\tClass Part : Num_const\t\tLine :%d ",line);}j=0;if((token[j]>64&&token[j]<91)||(token[j]>96&&token[j]<123)||token[j]=='_'){j++;while(token[j]!='\0')if((token[j]>64&&token[j]<91)||(token[j]>96&&token[j]<123)||token[j]=='_'||(token[j]<58&&token[j]>47))j++;else break;}if(token[j]=='\0'){printf("\nValue Part : ");for(int k=0;k<strlen(token);k++)putchar(token[k]);printf("\t\tClass Part : ID\t\tLine :%d ",line);}}check=false; j=0;}while(inputstring[i]!='\0');printf("\nValue Part : EOF\t\tClass Part : EOF");}the third last while loop is not working properly it seperates char by char not word by word 解决方案 这篇关于while循环不适用于多条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-16 10:30