Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Тестовые примеры / ch3 / ios
.C // source module: ios.C
#include <iostream.h>
int main()
{
int x = 1024;
double y= 200.0;
static char str[80] = "Hello";
cout.setf( ios::showbase | ios::showpos | ios::uppercase );
cout.setf( ios::scientific, ios::floatfield );
cout.precision(8);
cout << "'";
cout.width(10);
cout.fill('*');
cout << x << "', y='" << y << "'\n";
cout << "'";
cout.width(7);
cout.setf(ios::left,ios::adjustfield);
cout.setf(ios::fixed, ios::floatfield );
cout << x << "', y='" << y << "'\n";
cout << "'";
cout.width(8);
cout.setf(ios::right,ios::adjustfield);
cout << str << "'\n";
return 0;
}