题目大意:给出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 模拟的更多相关文章

  1. Uva - 12050 Palindrome Numbers【数论】

    题目链接:uva 12050 - Palindrome Numbers 题意:求第n个回文串 思路:首先可以知道的是长度为k的回文串个数有9*10^(k-1),那么依次计算,得出n是长度为多少的串,然 ...

  2. POJ2402/UVA 12050 Palindrome Numbers 数学思维

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...

  3. UVa 12050 - Palindrome Numbers (回文数)

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...

  4. 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 ≤ ...

  5. UVA - 13022 Sheldon Numbers(位运算)

    UVA - 13022 Sheldon Numbers 二进制形式满足ABA,ABAB数的个数(A为一定长度的1,B为一定长度的0). 其实就是寻找在二进制中满足所有的1串具有相同的长度,所有的0串也 ...

  6. UVa 10006 - Carmichael Numbers

    UVa 10006 - Carmichael Numbers An important topic nowadays in computer science is cryptography. Some ...

  7. Palindrome Numbers(LA2889)第n个回文数是?

     J - Palindrome Numbers Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu ...

  8. 2017ecjtu-summer training #1 UVA 12050

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...

  9. UVa - 12050

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...

随机推荐

  1. 整理的java的日期DateUtil

    package cn.knet.data.untils; import java.text.SimpleDateFormat; import java.util.Calendar; import ja ...

  2. 记在centos中连接无线网络的一次过程

    1. 首先, 你的系统要能驱动无限网卡, 要是人品好的话, 系统已经自带了你的网卡的驱动程序. 不然就要先搞定无线网卡的驱动再说. 不然后面的步骤也就没必要了. 2. 看一下你的无线网卡叫什么: iw ...

  3. 在linux下的firefox中安装flashplayer

    将 libflashplayer.so 复制进 ~/.mozilla/plugins/ 若目标目录不存在,请自行创建

  4. hadoop 启动停止命令

    1       批量启动与停止 1.1  Start-all.sh # Start all hadoop daemons.  Run this on master node. bin=`dirname ...

  5. Swift数据类型简介

    用 Swift 编写 iOS 和 OS X 应用将是一场美妙的体验,Swift 之后也会不断开发新特性和兼容性. Swift 提供了与C.Objective-C的相似的基础数据类型,包含整数Int,浮 ...

  6. OpenStack 镜像制作

    Contents [hide] 1 Centos6.5 img制作 1.1 基础环境安装 1.2 下载或从本地上传系统镜像 1.3 启动服务 1.4 建立镜像文件 1.5 通过virt-install ...

  7. 兼容IE, Chrome的ajax function

    gAjax.js var gAjax = (function () { /* paramObj:{ url: request url, method: GET or POST, encode: cha ...

  8. Array JSON

    Tool: Online jsonviewer JSON: JavaScript Object Notation. JSON is a syntax for storing and exchangin ...

  9. 设置 textarea 默认滑动到底部

    javascript: var textarea = document.getElementById('textarea_id'); textarea.scrollTop = textarea.scr ...

  10. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.9.Progressbar控件

    Progressbar控件用来显示任意进程的完成百分比. 默认安装启用 配置选项 控件暴露的事件API progressbar暴露的独一无二的方法 一些现实生活的例子 当前版本中,我们或系统必须明确进 ...