Files
ARPZ_s1_pr6/task9.h

35 lines
515 B
C++

#include <iostream>
#include <stack>
#include <fstream>
#include <string>
using namespace std;
#pragma once
namespace task9 {
int init()
{
cout << "TASK #9" << endl;
setlocale(LC_ALL, "Russian");
stack<char> chars;
ifstream input("C:\\input.txt");
string data;
while (getline(input, data))
{
for (char& c : data)
{
chars.push(c);
}
while (!chars.empty())
{
cout << chars.top();
chars.pop();
}
cout << endl;
}
return 0;
}
}