1. 程式人生 > 其它 >OpenCV之黑帽運算(C++實現)

OpenCV之黑帽運算(C++實現)

技術標籤:c語言

迴文

迴文串判斷
下列的字串函式希望小夥伴們自己查一下。

#include<stdio.h>
#include<string.h>
int main(){
	int n;
	scanf("%d",&n);//變數n表示接下來你要輸入幾組資料
	while(n--){//while迴圈
	char a[1000],b[1000];//字元陣列
	scanf("%s",a);
	strcpy(b,a);//複製函式
	strrev(b);//把目標函式倒轉
	if(strcmp(a,b)==0) printf("yes\n"
); else printf("no\n"); } return 0; }