A1069 . The Black Hole of Numbers (20)
来源:互联网 发布:淘宝最大的浏览单平台 编辑:程序博客网 时间:2024/06/06 19:55
#include<cstdio>#include<cstring>#include<algorithm>//仔细观察,合并using namespace std;bool cmp(char c1,char c2){return c1 > c2;}int main(){int n,n1,n2;char str[5];scanf("%d",&n);while(1){sprintf(str,"%04d",n);int len = strlen(str);sort(str,str+len);sscanf(str,"%d",&n1);sort(str,str+len,cmp);sscanf(str,"%d",&n2);n = n2 - n1;printf("%04d - %04d = %04d\n",n2,n1,n);if(n==0 || n == 6174) break;}return 0;}
0 0
- A1069 . The Black Hole of Numbers (20)
- PAT-A1069. The Black Hole of Numbers (20)(数学)
- pat-a1069. The Black Hole of Numbers (20)
- PAT A1069. The Black Hole of Numbers (20)
- PAT A1069 the black hole of numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- 1069. The Black Hole of Numbers (20)
- Servlet是否线程安全
- 模式对话框与非模式对话框的区别
- 求二叉树的深度
- CodeForces - 344E Read Time (模拟题 + 二分法)
- 网易游戏 从笔试到offer 经验分享
- A1069 . The Black Hole of Numbers (20)
- 社説 20150811 生殖補助医療 法整備に向けて議論深めよう
- 怎么样做一个好测试
- 从Hadoop到Spark的架构实践
- HDU2647 Reward 拓扑排序
- 在代码中获取ApplicationContext实例
- Eclipse的下没有Android sdk and avd manager
- Unity3D 中 点乘和叉乘的应用
- MyBatis魔法堂:Insert操作详解(返回主键、批量插入)