#include<iostream>
#include<cstring>
#include<cmath>
#define pi 3.14159265
using namespace std;
int main()
{
char format[10]={0};
int t;
cin>>t;
while(t--)
{
long long n,x;
scanf("%lld%lld",&n,&x);//求n的Pi次方,并且输出小数点后x位
sprintf(format,"%%.%dlf",x);
double ans;
ans=1.0*pow(n,pi);
printf(format,ans);
cout<<endl;
}
return 0;
}
原文:https://www.cnblogs.com/caijiaming/p/8998813.html