Test case failed. …
int main() {
float n;
cin>>n;
if(n<0)
return 0;
float ans = (9*n)/100;
cout<<setprecision(2)<<ans;
return 0;
}
Test case failed. …
int main() {
float n;
cin>>n;
if(n<0)
return 0;
float ans = (9*n)/100;
cout<<setprecision(2)<<ans;
return 0;
}
setprecision() do not prints the trailing zeroes if you call it simply.
use “fixed” to print trailing zeroes like these
cout<<fixed<<setprecision(2)<<x<<endl;