Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- float niza[n];
- for(int i = 0; i < n; i++) {
- cin >> niza[i];
- }
- float x;
- cin >> x;
- int dali_brojot_e_najden = 0;
- for(int i = 0; i < n; i++) {
- if(niza[i] == x) {
- cout << i << " ";
- dali_brojot_e_najden = 1;
- }
- }
- if(dali_brojot_e_najden == 0) {
- cout << "Baranata vrednost ne e vo nizata" << endl;
- }
- return 0;
- }
- /*
- 5
- 2 3 5 1 8
- 8
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement