AtCoder Beginner Contest 367 is over. Problem B this time is very good.
It says: Give you a real number to the third decimal place. Delete the unnecessary zeros and '.' .
I saw many participants using string and .pop_back(), but I have a simpler way:
Just input and then output (C++), because it can help you delete them.
Code:
#include<bits/stdc++.h>
using namespace std;
double a;
int main(){
cin>>a;
cout<<a<<endl;
return 0;
}
This takes you less time in the contest.
Thank you for reading!