Advertisement
SeriousVenom

13.02.2020

Feb 12th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. // 13.02.2020.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <stack>
  7. #include <fstream>
  8. #include <string>
  9.  
  10. using namespace std;
  11.  
  12.  
  13.  
  14. int main()
  15. {
  16.     ifstream file;
  17.     string line;
  18.     string C0 = "Lawrence"; //Origin city
  19.     stack <string> stk;
  20.     stk.push(C0); //Add origin city in stack
  21.  
  22.     file.open("CityFile.txt");
  23.     while (!file.eof()) {
  24.         getline(file, line);
  25.         cout << line << endl;
  26.         for (int i = 0; i < line.length(); i++) {
  27.             stk.push(line);
  28.         }
  29.     }
  30.    
  31.    
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement