#include<stdio.h>
#include<string.h>
char str[210];
int max[210][52]={0};
int sum(int n,int m);
int main(){
int i,k,n,m;
max[1][0]=1;
max[0][0]=1;
for(i=0;i<201;i++)
sum(i,i+1);
scanf("%d",&n);
while(n--){
scanf("%s",str);
m=strlen(str);
i=50;
k=0;
while(i--){
if(k){
printf("%d",max[m][i]);
continue;}
if(max[m][i-1]!=0)k=1;
}
printf("\n");
}
return 0;
} int sum(int n,int m){
int i=50;
while(i--){
max[m+1][i]=max[n][i]+max[m][i];
}
for(i=0;i<50;i++){ max[m+1][i+1]+=max[m+1][i]/10;
max[m+1][i]=max[m+1][i]%10;
}
return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

NYOJ-655 光棍的YY AC 分类: NYOJ 2013-12-29 19:24 224人阅读 评论(0) 收藏的更多相关文章

  1. Network Saboteur 分类: 搜索 POJ 2015-08-09 19:48 7人阅读 评论(0) 收藏

    Network Saboteur Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10147 Accepted: 4849 Des ...

  2. 欧拉通路-Play on Words 分类: POJ 图论 2015-08-06 19:13 4人阅读 评论(0) 收藏

    Play on Words Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10620 Accepted: 3602 Descri ...

  3. Hardwood Species 分类: POJ 树 2015-08-05 16:24 2人阅读 评论(0) 收藏

    Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 20619 Accepted: 8083 De ...

  4. Power Strings 分类: POJ 串 2015-07-31 19:05 8人阅读 评论(0) 收藏

    Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ ...

  5. 迷之节约 分类: sdutOJ 最小生成树 2015-06-24 19:10 10人阅读 评论(0) 收藏

    迷之节约 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 FF超级有钱,最近又买了n个(1 <= n <= 300)小岛,为 ...

  6. Hdu 1506 Largest Rectangle in a Histogram 分类: Brush Mode 2014-10-28 19:16 93人阅读 评论(0) 收藏

    Largest Rectangle in a Histogram Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 ...

  7. Least Common Ancestors 分类: ACM TYPE 2014-10-19 11:24 84人阅读 评论(0) 收藏

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  8. 二分图匹配 分类: ACM TYPE 2014-10-01 19:57 94人阅读 评论(0) 收藏

    #include<cstdio> #include<cstring> using namespace std; bool map[505][505]; int n, k; bo ...

  9. C语言之void类型及void指针 分类: C/C++ 2015-07-13 11:24 8人阅读 评论(0) 收藏

    原文网址:http://www.cnblogs.com/pengyingh/articles/2407267.html 1.概述 许多初学者对C/C 语言中的void及void指针类型不甚理解,因此在 ...

随机推荐

  1. windows实用技巧

    电脑如今已经非常普及,不过目前大多数电脑系统都是Win7/Win8.1或者Win10.你真的对自己电脑系统了解吗?今天小编为大家分享13个实用电脑技巧,会这些电脑技巧才叫牛哦! 13个实用电脑技巧 一 ...

  2. 一个特别不错的jQuery快捷键插件:js-hotkeys

    这其实不是什么新技术,这个插件在很早前就已经发布了,之前有项目用到,所以分享出来添加方式的例子 jQuery.hotkeys.add('esc',function (){ //执行函数 }); jQu ...

  3. php分页代码实例

    $result = "<div class=\"page-num\"><ul class=\"fn-clear\">" ...

  4. Yii整合ZF2及soap实例

    一)如何整合? // change the following paths if necessary $yii = dirname(__FILE__).'/framework/yii.php'; $c ...

  5. 用户View,五大布局

    1.LinearLayout 线性布局 android:orientation="horizontal" 制定线性布局的排列方式 水平 horizontal 垂直 vertical ...

  6. .Net之美

    第1章 C#类型基础 1.1 值类型和引用类型值类型和引用类型是以它们在计算机内存中是如何被分配的来划分的.值类型包括了结构和枚举,引用类型则包括了类. 接口. 委托等. 还有一种特殊的值类型,称为简 ...

  7. nandflash操作详解

    1.nandflash就是嵌入式系统的硬盘 2.分类(1)MLC:存储单元格存储两位,慢,偏移,寿命短,容量大(2)SLC:存储一位.快,寿命长,容量小,昂贵 3访问:(1)独立编址,有专用的控制器, ...

  8. PF_RING 实验

    前提:pf_ring.ko 运行在模式2    收包实验:        使用两台机器同时对装PF_RING的机器进行发包,此机器的网卡流量达到14M的效果.如下所示:     上图为PF_RING自 ...

  9. phpstorm自动对齐数组=>,自动加空格

    写完代码后可以点菜单中code-reformat code,快捷键是option+command+L

  10. 戏说PHP的嵌套函数

    PHP很早就支持嵌套函数了.并是不PHP5.3有闭包时才有的.然而,它却不是象JS,AS那样的闭包嵌套.即它的嵌套函数根本无闭包模式的逃脱. PHP嵌套函数有一些特别之处.最特别的是,当外部函数被调用 ...