-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (29 loc) · 688 Bytes
/
Copy pathmain.cpp
File metadata and controls
33 lines (29 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// main.cpp
// cpp_homework_36
//
// Created by Mark Semenov on 22.12.2022.
//
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
string term;
string temp;
char res[200];
cout << "Введите слово: ";
cin >> term;
ifstream(file);
file.open("files/db.txt", ios::in | ios::app);
char buffer[50];
while (!file.eof()) {
file.getline(buffer, 50);
temp = buffer;
}
if (term[term.length() - 2] == temp[temp.length() - 3] &&
term[term.length() - 1] == temp[temp.length() - 2]) {
cout << temp;
}
file.close();
}