Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 13.02.2020.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <stack>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- ifstream file;
- string line;
- string C0 = "Lawrence"; //Origin city
- stack <string> stk;
- stk.push(C0); //Add origin city in stack
- file.open("CityFile.txt");
- while (!file.eof()) {
- getline(file, line);
- cout << line << endl;
- for (int i = 0; i < line.length(); i++) {
- stk.push(line);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement