Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- long long n;
- cin>>n;
- long long arr[n];
- for(long long i=0; i<n ; i++)
- {
- cin>>arr[i];
- }
- long long x;
- cin>>x;
- for(long long i=0 ; i<n ; i++)
- {
- if(x==arr[i])
- {
- cout<<i;
- break;
- }
- else
- cout<<-1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement