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 ...
随机推荐
- js 判断当前的手机系统类型
<script language="javascript">window.onload = function () {alert("1");var ...
- python 练习 18
#!/usr/bin/python # -*- coding: UTF-8 -*- import time print time.strftime('%Y-%m-%d %H:%M:%S',time.l ...
- [bootstrap] 基本css样式和组件
一.基本css样式 01.全局设置 全局 font-size 是 14px,line-height 是 20px. 这些样式应用到了 <body> 和所有的段落上. 另外,对 <p& ...
- Compound Interest Calculator3.0续
1.你写的程序能让客户随意操作吗?误输入数据.不小心做了非常规的操作程序是什么反应? 2.如果向银行贷款10万元,年利率6.5%,期限为10年,那么每月等额本息还款多少?(算复利条件下等额还款金额) ...
- App crash 报错 'NSUnknownKeyException'
报错: *** Terminating app due to uncaught exception , reason: '[<NSObject 0x6e36ae0> setValue:fo ...
- 在进程View时的四个构造函数详解
public View(Context context):源代码中的解释如下:在Code中实例化一个View就会调用第一个构造函数 /** * Simple constructor to use wh ...
- Java 中equals和toString()方法重写
1,equals方法 (1)什么时候需要重写? 如果希望不同内存但相同内容的两个对象equals时返回true,则需要重写equals (2)怎么重写? class A { public int i; ...
- oracle知识点
创建序列 create sequence a_seq --创建序列名字为 a_seqminvalue 1 -- 最小值为 1maxvalue 99999 --- 最大值为 99999 start wi ...
- 328. Odd Even Linked List——多利用fake_head
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note her ...
- linux命令备份
sort -t $'\t' gcc版本查看 gcc -v 红帽版本查看 cat /etc/redhat-release Linux Core Version cat /proc/version