每增加1个整数,所有位上的对应数都加一。建立一个10000列10行的表,然后查表就可以了。

#include<stdio.h>
#include<string.h>
][];
int main(){
    memset(a,,sizeof(a));
    ;i<;i++){
        ;j<;j++)
            a[i][j]=a[i-][j];
        )
            a[i][k%]++;
    }//建表
    int n;
    //查表
    while(scanf("%d",&n) != EOF){
        ;j<n;j++){
            int m;
            scanf("%d",&m);
            ;i<;i++){
                if(i)
                    printf(" ");
                printf("%d",a[m][i]);
            }
            printf("\n");
        }

    }
    ;
}

UVA1225的更多相关文章

  1. [刷题]算法竞赛入门经典 3-1/UVa1585 3-2/UVa1586 3-3/UVa1225

    书上具体所有题目:http://pan.baidu.com/s/1hssH0KO(我也是在网上找到的pdf,但不记得是从哪里搜刮到的了,就重新上传了一遍) PS:第一次写博客分享我的代码,不知道我对c ...

  2. UVa1225 Digit Counting

    #include <stdio.h>#include <string.h> int main(){    int T, N, i, j;    int a[10];    sc ...

  3. 数数字(Digit Counting,ACM/ICPC Danang 2007,UVa1225)

    #include<stdio.h>#include<stdlib.h>#include<string.h>int main(){ char s[10000]; in ...

  4. 数数字 (Digit Counting,ACM/ICPC Dannang 2007 ,UVa1225)

    题目描述:算法竞赛入门经典习题3-3 #include <stdio.h> #include <string.h> int main(int argc, char *argv[ ...

  5. UVA1225 - Digit Counting(紫书习题3.3)

    Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequen ...

  6. 【习题 3-3 UVA-1225】Digit Counting

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 水模拟 [代码] #include <bits/stdc++.h> using namespace std; int a ...

  7. 习题3-3 数数字(Digit Counting , ACM/ICPC Danang 2007, UVa1225)

    #include<stdio.h> #include<string.h> int main() { char s[100]; scanf("%s",s); ...

随机推荐

  1. Canvas——使用定时器模拟动态加载动画!

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  2. 初识Azkaban

    先说下hadoop 内置工作流的不足 (1)支持job单一 (2)硬编码 (3)无可视化 (4)无调度机制 (5)无容错机制 在这种情况下Azkaban就出现了 1)Azkaban是什么 Azkaba ...

  3. Mac上安装MySQL记录

    下载最新的MySQL社区版 官方下载地址:http://dev.mysql.com/downloads/mysql/ 为了安装更方便,建议下载dmg安装包. 最新的版本是5.7.9. 安装MySQL ...

  4. Linux下面安装rpm包

    [root@localhost ~]# mount /dev/sdb4 /mnt/ [root@localhost ~]# cd /mnt[root@localhost mnt]# lsaddons ...

  5. 部署JProfiler监控tomcat

    下载JProfiler包 wget http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.rpm 安装JPr ...

  6. JS和JSON的区别

    JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,JSON格式的数据,主要是为了跨平台交流数据用的.但JSON和JavaScript确实存在渊源,可以说这种数 ...

  7. list<T> 的使用方法。

    首先讲一个经常用到的Contains( )方法,用来测试一个元素是否在List内.这个功能跟SQL里面的" like % %"类似. 这个方法在数组中也存在,因为集合其实就是动态数 ...

  8. Java学习笔记-抽象

    开发软件的关键在于应用抽象的概念.方法抽象是通过将方法的使用和它的实现分离来实现的.方法的实现对用户隐藏在"黑匣子"中. 当编写一个大程序时,可以使用分治的策略,也成为逐步求精,将 ...

  9. docker学习(6) docker中搭建java服务及nginx反向代理

    先看下容器规划: 上图中mysql容器的搭建见上篇博客,service1/2为java rest service,创建脚本如下: docker run -d -h service1 \ -v /Use ...

  10. [LeetCode] N-Queens II N皇后问题之二

    Follow up for N-Queens problem. Now, instead outputting board configurations, return the total numbe ...