Академический Документы
Профессиональный Документы
Культура Документы
PROBLEM SOLVING
Manipulators Action
setw (n) Set the field width to n
Set the decimal point precision to n
setprecision(n)
places
Display the number in conventional
setiosflags(ios::fixed)
fixed‐point decimal notation
int main()
{ float num=88.3333;
cout<<setiosflags(ios::fixed) <<setprecision(1)<<num;
return 0;
}
Output:
88.3
int main()
{ float num=8.3333;
cout<<setw(10)<<num;
return 0;
}
Output:
8.3333