-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput_format.cpp
26 lines (23 loc) · 1009 Bytes
/
output_format.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
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
// setw(cislo) - nastavi sirku
// left - zarovna doleva
// right - zarovna doprava
// setfill(znak) - nastavi vyplnovy znak
// setprecision(cislo) - presnost na des. cisla
// dec, oct, hex - nastavi ciselnou soustavu u cisel
// fixed - pro des. cisla, zapise des. cislo pouze pomoci cisel
// scientific - pro des. cisla, zapise des. cislo pomoci logaritmu
// uppercase, nouppercase - nastavi pismenka na velka nebo mala u hexadecimalnich cisel
for (int i = 0; i < 10000; i+=99){
cout << setw(10) << setfill('_') << right << hex << nouppercase << i << endl;
}
for (double i = 1; i > 0.00000001; i=i/2){
cout << setprecision(10) << fixed << i << endl;
}
cout << uppercase << "AhOj" << endl;
cout << nouppercase << "AhOj" << endl;
return 0;
}