Jump to content

[C++] Afisarea unor elemente la un anumit spatiu dat


zL Dark ReturN
 Share

Recommended Posts

Pentru a afisa unele elemente la un anumit spatiu dat, vom avea nevoie de urmatorul library:

#include <iomanip>

Pentru a afisa elementele dupa un anumit spatiu, vom folosi urmatoarea linie de cod inainte:

cout<<setw(5);

iar apoi elementul pe care vrem sa il afisam:

cout<<element;

Exemplu:

int element = 6;
cout<<setw(5)<<element;
     6
cout<<element;
6
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.