I have a social security program that I need finished. I have the code so far but I need to know how to make is where the user can only input numbers and no letters. This is what I have and I just do not know how to program only numbers.
`
#include<iostream>
#include <string>
using namespace std;
int main()
{
string ssn = "";
cout<< "Social Security number without hyphens: ";
getline(cin, ssn);
if (ssn.length() == 9)
{
ssn.insert(3, "-");
ssn.insert(6, "-");
cout << "Social Security number: " << ssn << endl;
}
else
cout << "The number must contain"
<< "9 characters" << endl;
system("pause");
return 0;
}`