-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintPretty.cpp
More file actions
46 lines (43 loc) · 786 Bytes
/
Copy pathprintPretty.cpp
File metadata and controls
46 lines (43 loc) · 786 Bytes
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
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
string remainder(int b;){
if(b <= 9){
return (b +48);
}else{
if(b == 10){return A;}
if(b == 11){return B;}
if(b == 12){return C;}
if(b == 13){return D;}
if(b == 14){return E;}
if(b == 15){return F;}
}
}
int main() {
int T; cin >> T;
cout << setiosflags(ios::uppercase);
cout << setw(0xf) << internal;
while(T > 0) {
double A; cin >> A;
double B; cin >> B;
double C; cin >> C;
int a = floor(A);
vector<char> v;
while(a >= 0){
v.push_back(remainder(a%16));
a = a/16;
}
char m[v.size()];
int i = 0;
while(v.size() > 0)){
m[i] = v[v.size()-1];
v.pop_back();
cout<<"0x"<<m[i];
i++;
}
cout<<"_______";
T--;
}
return 0;
}