Advertisement
semsem_elazazy

Untitled

Feb 5th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. long long  n;
  7. cin>>n;
  8. long long  arr[n];
  9.  
  10. for(long long i=0; i<n ; i++)
  11. {
  12.     cin>>arr[i];
  13.    
  14. }
  15. long long  x;
  16. cin>>x;
  17. for(long long i=0 ; i<n ; i++)
  18. {
  19.     if(x==arr[i])
  20.     {
  21.         cout<<i;
  22.         break;
  23.     }
  24.     else
  25.     cout<<-1;
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement