Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,x;
- cin>>n;
- int A[n];
- for (int i=0;i<n;i++)
- cin>>A[i];
- cin>>x;
- int pos=-1;
- for (int i=0;i<n;i++)
- {
- if (A[i]==x)
- {
- pos=i;
- break;
- }
- }
- if (pos==-1) cout<<"U nizu nema trazenog broja"<<endl;
- else cout<<"Broj se nalazi na poziciji "<<pos<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement