题目大意:给出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. demo03linearlayoutdemo;

    package com.example.demo03linearlayoutdemo; import android.os.Bundle; import android.app.Activity; i ...

  2. JQ 获取单选按钮选中的值

    ==========================html 代码 <input type="radio" style="float: left " on ...

  3. android 自定义view详解

    1.自定义View前首先要了解一下View的方法,虽然有些不一定要实现. 分类 方法 描述 创建 Constructors View中有两种类型的构造方法,一种是在代码中构建View,另一种是填充布局 ...

  4. centos 6 7更改主机名 命令添加ip

    6:vi /etc/sysconfig/network 中hostname =主机名 vi /etc/hosts  添加127.0.0.1相应的主机名 7: hostnamectl set-hostn ...

  5. Tomcat端口被占用快速解决方案

    在dos下,输入  netstat   -ano|findstr  8080 //说明:查看占用8080端口的进程 显示占用端口的进程 taskkill  /pid  6856  /f //说明,运行 ...

  6. 获取url中的参数\+发送ajax请求根路径|+获取复选框的值

    //获取url中的参数function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=( ...

  7. 161130、Dubbo+SpringMVC工程创建详解

    Dubbo出现的目的是为了应对现在高并发,高数据量请求的问题.目前的垂直应用架构已经无法满足现在大数据的冲击,SOA就应运而生,而Dubbo在国内使用的还是比较多,稳定性也比较不错. 架构 节点角色说 ...

  8. Linux下查看用户列表

    cat /etc/passwd 可以查看所有用户的列表 w 可以查看当前活跃的用户列表 cat /etc/group 查看用户组

  9. php如何支持实现多线程并发

    <?php if(function_exists('date_default_timezone_set')) { date_default_timezone_set('PRC'); } func ...

  10. Volley Get Post 方法

    Get String url = CommonInterfaceUrl.COMM_GetWorksDetailUrl + "/" + worksID; RequestQueue m ...