#include <iostream>
using namespace std;
int main() {
int vetor[5] = {10, 20, 30, 40, 50};
int n;
cout << "Digite um número: " << endl;
cin >> n;
bool achou = false;
for (int i = 0; i <= 4; i++) {
if (n == vetor[i]) {
cout << "O número " << n << " faz parte do vetor e está na posição " << (i + 1) << "." << endl;
achou = true;
}
}
if (!achou) {
cout << "O número " << n << " não faz parte do vetor." << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgaW50IHZldG9yWzVdID0gezEwLCAyMCwgMzAsIDQwLCA1MH07CiAgICBpbnQgbjsKICAgIGNvdXQgPDwgIkRpZ2l0ZSB1bSBuw7ptZXJvOiAiIDw8IGVuZGw7CiAgICBjaW4gPj4gbjsKICAgIGJvb2wgYWNob3UgPSBmYWxzZTsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8PSA0OyBpKyspIHsKICAgICAgICBpZiAobiA9PSB2ZXRvcltpXSkgewogICAgICAgICAgICBjb3V0IDw8ICJPIG7Dum1lcm8gIiA8PCBuIDw8ICIgZmF6IHBhcnRlIGRvIHZldG9yIGUgZXN0w6EgbmEgcG9zacOnw6NvICIgPDwgKGkgKyAxKSA8PCAiLiIgPDwgZW5kbDsKICAgICAgICAgICAgYWNob3UgPSB0cnVlOwogICAgICAgIH0KICAgIH0KCiAgICBpZiAoIWFjaG91KSB7CiAgICAgICAgY291dCA8PCAiTyBuw7ptZXJvICIgPDwgbiA8PCAiIG7Do28gZmF6IHBhcnRlIGRvIHZldG9yLiIgPDwgZW5kbDsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==