UVA 12050 - Palindrome Numbers 模拟

题目大意:给出i,输出第i个镜像数,不能有前导0.
题解:从外层开始模拟
#include <stdio.h>
int p(int x)
{
int sum, i;
;i<=x;i++)
sum *= ;
return sum;
}
int main()
{
], c;
while(~scanf("%d", &n))
{
)
break;
i=;
*p((i-)/))
{
n -= *p((i-)/);
i++;
}
c = (i+)/;
t=;
while(c)
{
c--;
cs[t]=;
while(n>p(c))
{
n -= p(c);
cs[t]++;
}
t++;
}
cs[]++;
;j<t;j++)
printf("%d", cs[j]);
==)
printf(]);
;j>=;j--)
printf("%d", cs[j]);
printf("\n");
}
;
}
UVA 12050 - Palindrome Numbers 模拟的更多相关文章
- Uva - 12050 Palindrome Numbers【数论】
题目链接:uva 12050 - Palindrome Numbers 题意:求第n个回文串 思路:首先可以知道的是长度为k的回文串个数有9*10^(k-1),那么依次计算,得出n是长度为多少的串,然 ...
- POJ2402/UVA 12050 Palindrome Numbers 数学思维
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...
- UVa 12050 - Palindrome Numbers (回文数)
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...
- UVa - 12050 Palindrome Numbers (二分)
Solve the equation: p ∗ e −x + q ∗ sin(x) + r ∗ cos(x) + s ∗ tan(x) + t ∗ x 2 + u = 0 where 0 ≤ x ≤ ...
- UVA - 13022 Sheldon Numbers(位运算)
UVA - 13022 Sheldon Numbers 二进制形式满足ABA,ABAB数的个数(A为一定长度的1,B为一定长度的0). 其实就是寻找在二进制中满足所有的1串具有相同的长度,所有的0串也 ...
- UVa 10006 - Carmichael Numbers
UVa 10006 - Carmichael Numbers An important topic nowadays in computer science is cryptography. Some ...
- Palindrome Numbers(LA2889)第n个回文数是?
J - Palindrome Numbers Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu ...
- 2017ecjtu-summer training #1 UVA 12050
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...
- UVa - 12050
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...
随机推荐
- Android -- 自定义View小Demo,关于Rect绘制Android机器人(一)
1,关于Rect和RectF类的区别以前一直没有去关注它,刚刚了解了一下才知道都是用来确定矩形的区域,不过Rect是int类型的坐标而RectF是float类型的坐标,所以说RectF要更加精确.现在 ...
- 3D语音天气球(源码分享)——完结篇
转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 开篇废话: 由于这篇文章是本系列最后一篇,有必要进行简单的回顾和思路整理. 这个程序是由两 ...
- CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页。
CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页. /*注释区域*/ 此为注释语法 一.样式表 (一)样式表的分类 1.内联样式表 和HTML联合显示,控 ...
- [笔记]PHP文件系统处理
PHP文件系统处理 ***所有的文件处理都是使用系统函数完成的. ***php文件处理 是 基于linux/unix系统为模型的, 在linux下完全没问题 在windows下有一些 有差别. ### ...
- yii2.0分页
本实例是对商品列表进行分页 1.Controller中,商品列表的方法actionList 引用分页类 actionList中: $goods_info=Goods::find()->joinW ...
- yii2顶部导航使用
yii2中使用顶部导航的具体方法: 1.视图中调用两个类: use yii\bootstrap\Nav;use yii\bootstrap\NavBar; 2. <?php ...
- Windows 10 访问网络共享 总是提示用户名或密码不正确的解决方法
今天同事在Windows10上共享了一些文件,其他使用Windows 7的同事都可以正常使用,唯独我是使用Windows 10操作系统的,和别人输入一样的用户名和密码,却总是告诉我:用户名或密码不正确 ...
- CMMI集谈
SEPG(Software Engineering Process Group)是软件工程过程组的缩写,指由软件过程专家组成的团队,负责在软件组织内推动和促进软件过程改进.最早在CMM中提出,1990 ...
- OpenStack collectd的从零安装客户端
1.查看是否需要增加yum 源 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@node-12 ~]# yum search collectd Loaded plugin ...
- sql创建删除修改表的基本操作
1 建立表格 在建立好数据库以后,就可以根据储存资料的需求,使用SQL叙述建立所有需要的表格(table).建立表格的设定非常多,以建立"world.city"表格来说,它的叙述会 ...