Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("PERECHI.txt");
- typedef struct
- {
- unsigned x, y;
- } PER;
- int main()
- {
- PER p[100];
- unsigned n, i;
- fin >> n;
- for (i = 0; i < n; i++)
- fin >> p[i].x >> p[i].y;
- for (i = 0; i < n; i++)
- {
- int x = p[i].x;
- int y = p[i].y;
- int inv = 0;
- while (y)
- {
- inv = 10 * inv + y % 10;
- y /= 10;
- }
- if (x == inv)
- cout << p[i].x << ' ' << p[i].y << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement