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的更多相关文章

  1. hdu 2042 - 不容易系列之二

    题意:(略)太长了 解法:找规律,发现A[i]=A[i-1]*2-2; 1: #include<stdlib.h> 2: #include<string.h> 3: #incl ...

  2. 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 ...

  3. hdu.2042 超级楼梯

    这种递归来写,除了递归我也想不到怎么写了 AC代码: #include<iostream>using namespace std;int x[41];//打表,不打表我不用想就知道过不了, ...

  4. 致初学者(三): HDU 2033~ 2043题解

    下面继续给出HDU 2033~2043的AC程序,供大家参考.2033~2043这10道题就被归结为“ACM程序设计期末考试(2006/06/07) ”和“2005实验班短学期考试 ”. HDU 20 ...

  5. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  6. hdu 1465:不容易系列之一(递推入门题)

    不容易系列之一 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  7. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  8. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  9. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

随机推荐

  1. 【bzoj1041】圆上的整点

    题意 给定一个圆\(x^2+y^2=z^2\),求圆周上有多少个点的坐标是整数. \(r\leq 2*10^9\) 分析 这道题目关键要知道一些勾股数的性质,剩下的就很好处理了. 勾股数的性质 参考: ...

  2. javascript图片切换

    JavaScript 图片滑动切换效果 作者:cloudgamer 时间: 2009-09-25 文档类型:原创 来自:蓝色理想 第 1 页 JavaScript 图片滑动切换效果 [1] 第 2 页 ...

  3. 创建SSTP VPN,适应win7, 控制台导入证书

    1. 按 视窗+r 打开运行,运行 mmc命令 2.打开控制台窗口 3.在默认界面 按 Ctrl+m 快捷键 打开添加单元 窗口,然后在其左侧列表双击 证书 项 4.在打开的证书管理单元 第一步中选择 ...

  4. hdu----(3118)Arbiter(构造二分图)

    Arbiter Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total S ...

  5. Xcode8 及iOS10适配问题汇总

    上点干货,目前得知的一些bug解决汇总:iOS10相册相机闪退bughttp://www.jianshu.com/p/5085430b029fiOS 10 因苹果健康导致闪退 crashhttp:// ...

  6. Play Framework介绍:主要概念(转)

    Play Framework是一个Rails风格的Full-stack Java Web框架. MVC模型 Play应用遵循Web架构使用的MVC架构模式. 它将应用分离到不同的层中:表现层(Pres ...

  7. js——常见的小方法

    1.随机得到是六位数,可以当做“密码”来使用: Math.random().toString().substr(2, 6):

  8. PHP中MySql函数收集

    1.array mysql_fetch_assoc ( resource $result ) 从结果集中取得一行作为关联数组 说明:  返回对应结果集的关联数组,并且继续移动内部数据指针. 参数:re ...

  9. 使用AlarmManager定时更换壁纸----之一

    import android.os.Bundle;import android.app.Activity;import android.app.AlarmManager;import android. ...

  10. Disaster Recovery, High Availability, and Continuous Availability - What's the Difference?

    Disaster Recovery, High Availability, and Continuous Availability - What's the Difference? Posted by ...