牛客网 牛客小白月赛1 A.简单题-控制输出格式setiosflags()函数+setprecision()函数

水一水博客,都不好意思写这篇博客,毕竟已经不是大一的了。

难得能把一整套题都写出来(日常智障)。但是在这里不写G题あなたの蛙は旅⽴っています的题解。

有毒,G题关了流同步只能过94%的样例,说我运行超时,开着就过了。无语,不想写。

A.简单题

链接:https://www.nowcoder.com/acm/contest/85/A
来源:牛客网

 

控制输出格式就可以,传送门:看看就会了

代码:

 #include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
int t,c;
double a,b;
cin>>t;
while(t--){
cin>>a>>b>>c;
double ans=exp(a)*b;
cout<<setiosflags(ios::fixed)<<setprecision(c)<<ans<<endl;
}
}


 
上一篇:python06-列表表达式、生成器表达式及其面试题、解耦简单介绍、函数递归相关


下一篇:Android的AndroidManifest.xml文件的详解