Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int highwayNumber;
  6.  
  7. cin >> highwayNumber;
  8.  
  9.  
  10. if (highwayNumber == 0){
  11.  
  12. cout << highwayNumber << " is not a valid interstate highway number." << endl;
  13.  
  14. }
  15.  
  16. else if (highwayNumber >= 100){
  17.  
  18. cout << "I-" << highwayNumber << " is auxiliary, serving I-" << highwayNumber % 100 << ", going north/south." << endl;
  19.  
  20. }
  21.  
  22.  
  23. else if (highwayNumber <= 99){
  24.  
  25. cout << "I-" << highwayNumber << " is primary, going north/south." << endl;
  26.  
  27. }
  28.  
  29. else if (highwayNumber == 0){
  30.  
  31. cout << "I-" << highwayNumber << " is primary, going north/south." << endl;
  32.  
  33. }
  34.  
  35. else{
  36.  
  37. cout << highwayNumber << " is not a valid interstate highway number." << endl;
  38.  
  39.  
  40. }
  41.  
  42.  
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement