C課程設計編寫程式,判斷符串是否為迴文,迴文即順讀和逆讀都一樣的字串,如madam,

時間 2021-06-13 09:11:56

1樓:海龜崽

、int palindrome_test()//判別輸入的字串是否迴文序列,是則返回1,否則返回0

while(!stackempty(s))return ok;

}//palindrome_test

2樓:清風or朗月

#include"stdio.h"

#include"stdlib.h"

#include"string.h"

#define len sizeof(stack)#define null 0

typedef struct node

stack;

int n;//記錄棧中資料的個數;

//初始化棧

stack *initstack()

//進棧操作

stack *push(stack *top,char strl[100])

else

break;

}printf("棧中的資料有%d個\n",n);

return(top);

}//出棧運算

stack *pop(stack *top,char strl[100])

zhou:

if(n!=0)

printf("這個字串是迴文!\n");

}else

cheng:

if(n!=0)

printf("這個字串是迴文!\n");

}return(top);

}void main()

3樓:失戀的賴草

#include

#include

#define n 20

int main()

return 0;}

C語言編寫程式,判斷輸入的字串是否是回文

小夏在深圳 源 如下 include int main int n,reversedinteger 0,remainder,originalinteger printf 輸入乙個整數 scanf d n originalinteger n 翻轉 while n 0 remainder n 10 re...