?? diguixiajiang.c
字號:
#include "conio.h"
#include"stdio.h"
char sym;
int p;
int flag=1;
char *ju="i+i*i" ;
void e(void);
void t(void);
void e1(void);
void t1(void);
void f(void);
void main(){
clrscr();
sym=ju[0];
p=0;
e();
if((sym=='\0')&&(flag==1))
printf("it is a sentence of the produce formula!!!\n");
else
printf("it isnot a sentence of the produce formula!!!!\n");
}
void e(void){
t();
e1();
}
void t(void){
f();
t1();
}
void e1(void){
if (sym=='+') {
p=p+1;
sym=ju[p];
t();
e1(); }
}
void t1(){
if (sym=='*'){
p=p+1;
sym=ju[p];
f();
t1();
}
}
void f(){
if (sym=='i')
{p=p+1;
sym=ju[p];
}
else
{ if(sym=='(')
{ p=p+1;
sym=ju[p];
e();
if(sym==')'){
p=p+1;
sym=ju[p];}
else
{ flag=0;
printf("error )is missing\n");}
}
else
{ flag=0;
printf("error f()can't allow other character \n");}
} }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -