alphacademy-cpp/archive/hf16/2.cpp

38 lines
783 B
C++
Raw Permalink Normal View History

2022-10-08 11:05:44 +00:00
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
bool tukorSzam(string a) {
//ez undorító de nincs jobb ötletem xd
if (a[0] == a[7]) {
if (a[1] == a[6]) {
if (a[2] == a[5]) {
if (a[3] == a[4]) {
return true;
}
return false;
}
return false;
}
return false;
}
return false;
}
int main() {
int n;
cin>>n;
vector<string> telefonszamok(n);
for (int i = 0; i < n; i++) {
cin >> telefonszamok[i];
}
cout<<endl;
vector<string> out;
for (int i = 0; i < telefonszamok.size(); i++) {
if (tukorSzam(telefonszamok[i])) {
cout<<telefonszamok[i]<<endl;
}
}
}