SeriousVenom

whatafuckmotherfuck

Feb 18th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <stack>
  3. #include <fstream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8.  
  9.  
  10. int main()
  11. {
  12.     int menu=0;
  13.     ifstream file;
  14.     string line;
  15.     string C0 = "Lawrence"; //Origin city
  16.     stack <string> stk;
  17.     stk.push(C0); //Add origin city in stack
  18.  
  19.  
  20.    
  21.        
  22.     cout << "FlexAir \n 1. All available cities \n 2. Available routes \n 3. Booked flights \n 4.Exit \n Your choice: "; cin >> menu;
  23.    
  24.     if (menu == 1) {
  25.             file.open("City.txt");
  26.             while (!file.eof()) {
  27.                 getline(file, line);
  28.                 cout << line << endl;
  29.                 for (int i = 0; i < line.length(); i++) {
  30.                     stk.push(line);
  31.                 }
  32.             }
  33.         }
  34.  
  35.         if (menu == 2) {
  36.             file.open("From.txt");
  37.             while (!file.eof()) {
  38.                 getline(file, line);
  39.                 cout << line << endl;
  40.             }
  41.  
  42.         }
  43.  
  44.  
  45.    
  46.     return 0;
  47. }
Add Comment
Please, Sign In to add comment