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.
string integer = to_string(abs((int)B));
cout << setw(0) << "0x" << hex << (int)A << endl;
if (B > 0) {
cout << setw(15 - (integer.length() + 3)) << setfill('_') << fixed << setprecision(2) << '+' << B << endl;
} else {
cout << setw(15) << setfill('_') << fixed << setprecision(2) << B << endl;
}
cout << setw(0) << scientific << setprecision(9) << C << endl;
cout << endl;
Here is my source code, but I can only pass case 1. I have no idea where the error is.
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 →