Formatowanie wyprowadzonych wyników. Własne typy danych, stałe i stos
Napisano w Programy
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
#define LICZBA 10
#define NAPIS „Michał”
int tab[LICZBA];
int i=1;
double dana=3.13579013579;
cout<< „liczba= ” <<LICZBA<<endl;
cout<< „napis= ” <<NAPIS<<endl<<endl;
//domyslnie
cout<<„domyslnie”<<endl;
cout<<dana<<endl;
//setprecision
cout<<„setprecision”<<endl;
cout<<setprecision(9)<<dana<<endl;
//width
cout<<„width”<<endl;
cout.width(1);
cout<<i<<” – „<<dana<<endl;
//setfill
cout<<„setfill”<<endl;
cout<<setfill(’x')<<setw(9)<<„77″<<endl;