mirea-projects/First term/Algorithms/extra/9.cpp

25 lines
382 B
C++
Raw Normal View History

2024-09-23 23:22:33 +00:00
#include <stack>
#include <fstream>
#include <iostream>
using namespace std;
int main() {
stack<char> stack;
ifstream inputFile("input.txt");
if (inputFile.is_open()) {
while (inputFile) {
stack.push(inputFile.get());
}
}
stack.pop();
while (!stack.empty()) {
cout << char(stack.top());
stack.pop();
}
return 0;
}