回文字符串的测试
来源:互联网 发布:qq飞车指挥官改装数据 编辑:程序博客网 时间:2024/06/06 08:39
#include <iostream> using namespace std;void test_int_circle(const int a){int num = a;int b[10];int i = 0;int begin, end;int temp;while (num){temp = num % 10;b[i] = temp;i++;num = num / 10;}begin = 0;end = i - 1;while(begin < end){if (b[begin] == b[end]){begin++;end--;} else{break; }}if (begin < end){printf("false\n");} else{printf("true\n");}}void test_char_circle(const char a[], const int length){int begin = 0, end = length -1;while(a[begin] != NULL && begin < end){if (a[begin] == a[end]){begin++;end--;} else{break;}}if (begin < end){cout<<"false"<<endl;} else{cout<<"true"<<endl;}}int main(){/*int a;cout<<"please input the number of you:"<<endl;cin>>a;test_circle(a);/*char a[]={"aaaaaaa"};cout<<"please input 3 char:"<<endl;char a[4];scanf("%s",a);test_char_circle(a,sizeof(a)-1);printf("%s\n",a);return 0;}
直接上代码
- 回文字符串的测试
- 最长的回文字符串
- 回文字符串的判断
- 回文字符串的判断
- 回文数与回文字符串的判断
- 回文字符串 的添加问题
- 字符串的最长回文字串
- 字符串的最长回文长度
- 字符串的最大回文长度
- 回文字符串的注意点
- 一个回文字符串的例子
- 回文字符串的最大长度
- 寻找最大的回文字符串
- 测试一个c风格字符串是否是回文字符串
- 字符串中最长的回文字符串长度
- Leetcode-字符串问题--最长的回文字符串
- 字符串删除字符的回文字符串
- 还是回文 && 回文字符串
- Request.返回值
- POJ 3126 Prime Path BFS
- sql developer无法更新数据
- 教你用VS2008/VS2010写简单C/C++语言main函数程序
- C# 中的委托和事件
- 回文字符串的测试
- windows下安装emacs收藏
- 如果分配给命令的连接位于本地挂起事务中,ExecuteNonQuery 要求命令拥有事务。命令的 Transaction 属性尚未初始化
- C#獲取指定文件夾的所有檔案
- 对话框大全
- jstl标签库
- 雷声大雨点小!!!
- WinForm应用程序框架设计之WinAction(数据操作)
- Java上传