新同学的年龄
来源:互联网 发布:元胞自动机 python 编辑:程序博客网 时间:2024/04/28 01:49
/*
* 52.cpp
*
* Created on: 2011-8-9
* Author: san
*/
# include <stdio.h>
int main(void)
{
long a[10] = {
0
};
long s[10] = {
0
};
int i;
long n3;
long n4;
int x = 18;
do
{
n3 = x*x*x;
for (i=3; i>=0; i--)
{
a[i] = n3 % 10;
n3 /= 10;
}
n4 = x*x*x*x;
for (i=9; i>=4; i--)
{
a[i] = n4 % 10;
n4 /= 10;
}
for (i=0; i<=9; i++)
s[a[i]]++;
for (i=0; i<=9; i++)
if(s[i]==1) /*判断有无重复数字*/
{
if(i==9)
printf("\n the number is %d\n",x);/*将结果输出*/
}
else break;/*跳出for循环*/
x++;
} while (x<22);
return 0;
}
* 52.cpp
*
* Created on: 2011-8-9
* Author: san
*/
# include <stdio.h>
int main(void)
{
long a[10] = {
0
};
long s[10] = {
0
};
int i;
long n3;
long n4;
int x = 18;
do
{
n3 = x*x*x;
for (i=3; i>=0; i--)
{
a[i] = n3 % 10;
n3 /= 10;
}
n4 = x*x*x*x;
for (i=9; i>=4; i--)
{
a[i] = n4 % 10;
n4 /= 10;
}
for (i=0; i<=9; i++)
s[a[i]]++;
for (i=0; i<=9; i++)
if(s[i]==1) /*判断有无重复数字*/
{
if(i==9)
printf("\n the number is %d\n",x);/*将结果输出*/
}
else break;/*跳出for循环*/
x++;
} while (x<22);
return 0;
}
- 新同学的年龄
- 同学分享的新的
- 新同学
- 给新同学的礼仪建议
- 新同学需要掌握的linux常用命令
- 欢迎--CNDN新同学
- 又来新同学
- 写下连接数据库的方法。供新同学学习下
- 写给新接触linq的同学(一)匿名类
- 与15级新加入团队同学的约定
- 刚刚开始学习前端跟新入行的同学共同进步!
- 关于CVS和Checkstyle的使用(给组里的新同学)(一)
- 关于CVS和Checkstyle的使用(给组里的新同学)(二)
- 给新考上北大软件与微电子学院的同学——利用北大资源
- 写给新接触linq的同学(二)lamda从零来理解
- 给新同学讲一下我是怎么靠APP开发赚了上亿的
- 泡泡同学的微博跟新了,bfc和 ifc
- 新同学老司机们,说说你的第一次......上云体验!
- Android中弹出输入法界面不影响app界面布局
- 非阻塞connect,错误码:EINPROGRESS
- 递归求年龄
- rand 和 srand产生随机数
- 强制删除文件夹的软件
- 新同学的年龄
- 核心调试技术(一)
- 平均身高
- 封装了nand flash写函数
- 小球落地
- 字符串连接
- PhoneGap API帮助文档翻译—Capture (采集)
- 如何创建守护进程
- 字符串倒置