标签:while include char break span clu turn bsp int
1 //判断字符串是否是回文字符 2 #include<stdio.h> 3 #include<string.h> //字符串的strlen函数 4 int main() 5 { 6 int i, j; 7 char ch[100]; 8 gets(ch); //字符串输入 9 i = 0; 10 j = strlen(ch) - 1; 11 while (i<j) 12 { 13 if (ch[i]==ch[j]) 14 { 15 i++; 16 j--; 17 } 18 else 19 break; 20 } 21 if (i >= j) 22 printf("yes!\n"); 23 else 24 printf("No."); 25 26 return 0; 27 }
标签:while include char break span clu turn bsp int
原文地址:https://www.cnblogs.com/old-horse/p/12686422.html