#include <iostream.h>
#include <iomanip.h>
main()
{
int c = 27, d = 26;
float f = 3.1415927872;
cout << setw(15) << "Hexadezimal: "
<< setfill('#') << setw(10)
<< hex << c
<< "," << setw(8)
<< d << endl;
cout << setw(15) << setfill(' ')
<< "Float: " << setfill('.')
<< setw(10) << setprecision(2)
<< f << endl;
}
Ausgabe:
Hexadezimal: ########1b,######1a
Float: .......3.1
| © 1997 Gottfried Rudorfer, C++-AG, Lehrveranstaltungen, Abteilung für Angewandte Informatik, Wirtschaftsuniversität Wien, 1/11/1999 |