Added my works from 2022
This commit is contained in:
35
task9.h
Normal file
35
task9.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user