#include<iostream>
using namespace std; double foo(int n,double x)
{
  if(1==n)
  {
return x;
  }
  else
  {
if(n%2==0)
  return foo(n/2,x*x);
else
  return x*foo((n-1)/2, x*x);
  }
} int main()
{
  int n;
  double x;
  cin >> x >>n;
  cout<< foo(n,x) <<endl;
}

  

随机推荐

  1. BNUOJ 2461 Anniversary party

    Anniversary party Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on PKU. Origi ...

  2. 53. spring boot系列合集【从零开始学Spring Boot】

    前40章节的spring boot系列已经打包成PDF在csdn进行发布了,如果有需要的可以进行下载. 下载地址:http://download.csdn.net/detail/linxinglian ...

  3. 438D - The Child and Sequence

    D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input st ...

  4. 救命(洛谷 U4525)

    题目背景 XS中学的校长积劳成疾,最终由于无聊而卧病在沙发.需要药(pi)水(gu)拯救他的生活. 题目描述 现在有n种药水,编号分别为1..n,能拯救校长的药水编号为n 每个药水都可以购买到,但有的 ...

  5. Html5 history Api简介

    一. Html4的History API back() 后退,跟按下“后退”键是等效的. forward() 前进,跟按下“前进”键是等效的. go() 用法:history.go(x):在历史的范围 ...

  6. 一个MySQL-JDBC驱动bug引起的血案……

    问题背景 公司是做电商系统的,整个系统搭建在华为云上.系统设计的时候,考虑到后续的用户和订单数量比较大,需要使用一些大数据库的组件.关系型数据库这块,考虑到后续数据量的快速增长,不是直接写入MySQL ...

  7. iOS_截屏并裁剪

    截图使用场景: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcHJlX2VtaW5lbnQ=/font/5a6L5L2T/fontsize/400/fil ...

  8. css高级:font-size

    body{ font:62.5%/1.6em "Lucida Grande",Verdana,Geneva,Helvetica,Arial,sansserif; }//font-s ...

  9. iOS 中删除cookie的正确做法

    需求:删除 qq 登录的 cookie,保证下次打开 qq 登录页面不会默认登录 实现:      NSString *url =@"https://w.mail.qq.com/cgi-bi ...

  10. ORA-00904:&quot;T1&quot;.&quot;AREA_ID&quot; :标识符无效

    1.错误描写叙述 ORA-00904:"T1"."AREA_ID" :标识符无效 00904 . 00000 - "%s:invalid identi ...