24分蒟蒻求助
查看原帖
24分蒟蒻求助
600128
zzc101207楼主2022/12/3 16:15
#include<bits/stdc++.h>
using namespace std;
double fastMi(double x,int y){
   if(y==1){
   	return x;
   }
   double z=fastMi(x,y/2);
   if(y%2==0){
   	return z*z;
   }else{
   	return z*z*x;
   }
}
int main()
{
   double n,p,m;
   cin>>n>>p>>m;
   cout<<fixed<<setprecision(3)<<n*fastMi(1+p,m)<<endl;
   return 0;
}
2022/12/3 16:15
加载中...