How to take line break in the library "Cin"?

How can I take the line break when reading some variable with cin?

#include <iostream>
using namespace std;

int main()
{
    int dia, mes, ano;
    cout<< "Data: ";
    cin>> dia;cout<<"/";  cin>> mes;cout<<"/";  cin>> ano;
    system("pause");
    return 0;
}

Compiled: Result

I want it to look like this: How it should be

Author: Maniero, 2018-01-06

1 answers

Is not possible. The cin is made for basic use, for experimentation, minimal interaction without ceremony. If you want to have full control over the data entry you will have to write code that makes the control the way you want, which is not simple to do right. C++ is not a language that delivers everything ready and it is rare to have external libraries that are not very generic.

 3
Author: Maniero, 2018-01-06 10:30:41