本题实际上是计算3^n。编程中需要注意输出格式。???
为森么?数学问题搞不清楚辽······
注意输出格式
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int t,n;
cin>>t;
while(t--){
cin>>n;
printf("%.lf\n", pow(3, n));双精度输出格式
}
return 0;
}
本题实际上是计算3^n。编程中需要注意输出格式。???
为森么?数学问题搞不清楚辽······
注意输出格式
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int t,n;
cin>>t;
while(t--){
cin>>n;
printf("%.lf\n", pow(3, n));双精度输出格式
}
return 0;
}
相关文章: