zoukankan      html  css  js  c++  java
  • hdu 1165 Eddy's research II

    http://acm.hdu.edu.cn/showproblem.php?pid=1165

     1 #include <cstdio>
     2 #include <cstring>
     3 #include <algorithm>
     4 #define ll __int64
     5 using namespace std;
     6 
     7 ll A(ll m, ll n)
     8 {
     9     if(n==0) return A(m-1,1);
    10     else if(m==1) return n+2;
    11     else if(m==2) return 2*n+3;
    12     else return A(m,n-1)*2+3;
    13 }
    14 
    15 int main()
    16 {
    17     ll m,n;
    18     while(scanf("%I64d%I64d",&m,&n)!=EOF)
    19     {
    20         printf("%I64d
    ",A(m,n));
    21     }
    22     return 0;
    23 }
    View Code
  • 相关阅读:
    设计模式
    C++下char/string跟int型转换比较
    function
    流程控制
    运算符
    type
    language
    phpbasic
    html标签集合
    课题六
  • 原文地址:https://www.cnblogs.com/fanminghui/p/3871752.html
Copyright © 2011-2022 走看看