-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathprettyprint.cpp
37 lines (30 loc) · 988 Bytes
/
prettyprint.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Print Pretty
// This challenge will test your knowledge of the STL <iomanip> library.
//
// https://www.hackerrank.com/challenges/prettyprint/problem
//
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int T; cin >> T;
cout << setiosflags(ios::uppercase);
cout << setw(0xf) << internal;
while(T--) {
double A; cin >> A;
double B; cin >> B;
double C; cin >> C;
// (skeliton_head) ----------------------------------------------------------------------
// LINE 1
cout << hex << left << showbase << nouppercase;
cout << (long long unsigned int)A << endl;
// LINE 2
cout << dec << right << setw(15) << setfill('_') << showpos << fixed << setprecision(2);
cout << B << endl;
// LINE 3
cout << scientific << uppercase << noshowpos << setprecision(9);
cout << C << endl;
// (skeliton_tail) ----------------------------------------------------------------------
}
return 0;
}