hdu 2042
Ps:。。。好简单的一道题...直接AC,就是利用递归
代码:
#include "stdio.h"
int find(int num,int n);
int main(){
int n,i,m;
while(~scanf("%d",&n)){
for(i=0;i<n;i++){
scanf("%d",&m);
printf("%d\n",find(3,m));
}
}
return 0;
}
int find(int num,int n){
if(n==0) return num;
return find((num-1)*2,n-1);
}
hdu 2042的更多相关文章
- hdu 2042 - 不容易系列之二
题意:(略)太长了 解法:找规律,发现A[i]=A[i-1]*2-2; 1: #include<stdlib.h> 2: #include<string.h> 3: #incl ...
- HDU 2042 不容易系列之二 [补6.24] 分类: ACM 2015-06-26 20:40 9人阅读 评论(0) 收藏
不容易系列之二 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Su ...
- hdu.2042 超级楼梯
这种递归来写,除了递归我也想不到怎么写了 AC代码: #include<iostream>using namespace std;int x[41];//打表,不打表我不用想就知道过不了, ...
- 致初学者(三): HDU 2033~ 2043题解
下面继续给出HDU 2033~2043的AC程序,供大家参考.2033~2043这10道题就被归结为“ACM程序设计期末考试(2006/06/07) ”和“2005实验班短学期考试 ”. HDU 20 ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- hdu 1465:不容易系列之一(递推入门题)
不容易系列之一 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Sub ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
随机推荐
- C语言中随机数相关问题
用C语言产生随机数重要用到rand函数.srand函数.及宏RAND_MAX(32767),它们均在stdlib.h中进行了声明. int rand(void);//生成一个随机数 voidsrand ...
- Sql Server判断某列字段是否为空或判断某列字段长度
1.用is null 和 is not null来判断字段是否为空. 2.用len()函数来判断字段长度.
- canvas drawImage异步特性
先看代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- [saiku] 登陆/选择cube 时发生了什么
一 登陆saiku时发生了什么 大致流程 saiku 默认有admin和两个开发人员的身份 登陆saiku时,后台用户认证成功后创建了用户信息session 并在session中存储了随机生成的一个s ...
- 关于byte[]字节传输的大端和小端小议
当前的存储器,多以byte为访问的最小单元,当一个逻辑上的地址必须分割为物理上的若干单元时就存在了先放谁后放谁的问题,于是端(endian)的问题应运而生了,对于不同的存储方法,就有大端(big-en ...
- hdu----(2848)Repository(trie树变形)
Repository Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- nyoj------170网络的可靠性
网络的可靠性 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 A公司是全球依靠的互联网解决方案提供商,也是2010年世博会的高级赞助商.它将提供先进的网络协作技术,展 ...
- jquery中ajax常用方法
index.html: <h3>$.get(url, [data], [callback], [type])<br/> $.post(url, [data], [callbac ...
- asp.net core StaticFiles中间件修改wwwroot
new StaticFileOptions() { FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentD ...
- SQL语句的用法
1.增加字段 alter table docdsp add dspcodechar(200)2.删除字段 ALTER TABLE table_NAME DROP COLUMNc ...