i am writing a program the reads 5 digit zip code and calculates check digit.
take a look at a piece of my code
1 2 3 4 5 6
cout << "Enter your zip code followed by space after each number then hit [Enter]: ";
cin >> zip1 >> zip2 >> zip3>> zip4 >> zip5; //take the zip code numbers and store each number in a variable
CheckDigit = (zip1 + zip2 + zip3 + zip4 + zip5)%10; //line 80 and 81 is to calculate he check digit
CheckDigit = 10-CheckDigit;
that only accepts digits followed by a space but what if the user decided to put it all together like 12345 instead of 1 2 3 4 5??? thanksssssss