64,650
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int num;
double x,y;
cin>>num;
while(num--)
{
cin>>x;
if(x<1) y=x;
else if(x>=10) y=3*x-11;
else y=2*x-1;
if(y==(int)y) cout<<y<<endl;
else cout<<fixed<<setprecision(1)<<y<<endl;
}
}
/*
5
5
5.2
5
*/