A2: symmetric digits
来源:互联网 发布:千牛淘宝卖家怎么发货 编辑:程序博客网 时间:2024/06/11 22:44
integers of symmetric digits
coplexity: O(n)
#include <iostream>#include <vector>using namespace std;bool isSymetric( int x ) {char buff[32];int i=0;while( x != 0){buff[i++] = x%10;x/=10;}int j=0;i-=1;while( j<i) {if(buff[j++] != buff[i--] ) return false;}return true;}int main(int argc, char** argv){int x[] = {0, INT_MAX, INT_MIN, 123454321, 123453421};int sz = sizeof(x) / sizeof(int);for( int i=0; i<sz; i++) {cout<<isSymetric(x[i])<<endl;}}
- A2: symmetric digits
- a2
- a2
- a2
- A2
- a2
- 出差A2
- Cindy 3.0a2 released
- A2.3封装 P374
- ROS 测试RPLIDAR-A2
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- Symmetric Tree
- 有想像力的程序员才有未来
- 投资学,从入门到精通,七本书
- 华夏智软 整合成功,最新域名 hxdev.cn
- 图片上传问题的解决
- WP8开发环境随想
- A2: symmetric digits
- A3: pythagorean
- [leetcode] Remove Duplicates from Sorted List II
- 38(60)--windows internals 6 david mark alex
- CodeSmith 使用教程(13) 调试
- osgcatch例子
- [Ubuntu] ubuntu/LINUX游戏集锦(更新十余款大型3D游戏)
- RC4算法
- RC4加密算法在C#中的实现