Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. ostream& tab(ostream& out) {
  6.     out << setprecision(1);
  7.     out << fixed;
  8.     out << width(5);
  9.     return out;
  10.  
  11. }
  12. ostream& percent(ostream& out) {
  13.     out << '%';
  14.     return out;
  15. }
  16.  
  17.  
  18.  
  19.  
  20. /*** Main ***/
  21. int main() {
  22.     double x = 55.55;
  23.     cout << tab << 5555 << percent;
  24.     //cout << "55.666" << percent << endl;
  25.     //cout << "55.777" << percent << endl;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement