Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream> // 506
- using namespace std;
- int main() {
- long long n, v[100], i, oglindit = 0, x;
- bool a;
- cin >> n;
- for (i = 1; i <= n; i++)
- cin >> v[i];
- // aflam oglinditul primului numar din sir
- x = v[1];
- while (x) {
- oglindit = oglindit * 10 + x % 10;
- x /= 10;
- }
- // verificam daca sirul contine oglinditul primului numar
- a = false;
- for (i = 1; i <= n; i++) {
- if (v[i] == oglindit) {
- a = true;
- break;
- }
- }
- if (a == true)
- cout << "DA";
- else
- cout << "NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement