3.31
作者:互联网
1 #include<stdio.h> 2 typedef struct{ 3 char element[50]; 4 int front,rear; 5 }SeqQueue; 6 void Create(SeqQueue*S) 7 { 8 S->front=0; 9 S->rear=0; 10 char e; 11 e=getchar(); 12 S->element[S->rear]=e; 13 e=getchar(); 14 while(e!='@') 15 { 16 S->rear++; 17 S->element[S->rear]=e; 18 e=getchar(); 19 } 20 } 21 int Judge(SeqQueue*S) 22 { 23 int a=S->front,b=S->rear; 24 while(a<b) 25 { 26 if(S->element[a]!=S->element[b])return 0; 27 a++,b--; 28 } 29 return 1; 30 } 31 int main() 32 { 33 SeqQueue S; 34 Create(&S); 35 if(Judge(&S))printf("yes"); 36 else printf("no"); 37 return 0; 38 }
标签:return,int,SeqQueue,element,3.31,rear,getchar 来源: https://www.cnblogs.com/JT3895/p/15659658.html