Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int highwayNumber;
- cin >> highwayNumber;
- if (highwayNumber == 0){
- cout << highwayNumber << " is not a valid interstate highway number." << endl;
- }
- else if (highwayNumber >= 100){
- cout << "I-" << highwayNumber << " is auxiliary, serving I-" << highwayNumber % 100 << ", going north/south." << endl;
- }
- else if (highwayNumber <= 99){
- cout << "I-" << highwayNumber << " is primary, going north/south." << endl;
- }
- else if (highwayNumber == 0){
- cout << "I-" << highwayNumber << " is primary, going north/south." << endl;
- }
- else{
- cout << highwayNumber << " is not a valid interstate highway number." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement