Reference solution
Time: O(1) · Space: O(1)One correct implementation. Any approach that satisfies the constraints is equally valid.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int i;
double d;
char c;
bool b;
if (!(cin >> i >> d >> c >> b)) return 0;
cout << i << ' ' << fixed << setprecision(2) << d << ' ' << c << ' ' << b << '\n';
return 0;
}