We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<iostream>#include<iomanip> usingnamespacestd;intmain(){intT;cin>>T;cout<<setiosflags(ios::uppercase);cout<<setw(0xf)<<internal;while(T--){doubleA;cin>>A;doubleB;cin>>B;doubleC;cin>>C;/* Enter your code here *///find length of the B's realpart longinttemp=int(B);intdigitCount=0;while(temp){digitCount++;temp/=10;}//add 3 (. + 2decimal part)digitCount+=3;cout<<setw(0)<<showbase<<hex<<nouppercase<<(longlong)A<<endl;cout<<uppercase<<setw(0xf);cout<<setw(15-digitCount)<<setfill('_')<<'+'<<fixed<<setprecision(2)<<B<<endl;cout<<scientific<<setprecision(9)<<C<<endl;cout.precision();cout<<defaultfloat;}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Print Pretty
You are viewing a single comment's thread. Return to all comments →
Sicne they have included iomanip