Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- ios_base::sync_with_stdio(false);
- cin.tie();
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- // n = size
- // arr = {..}
- // x
- int n; cin >> n;
- int arr[n];
- for(int i = 0; i < n; i++){
- cin >> arr[i];
- }
- int x; cin >> x;
- bool found = false;
- for(int i = 0; i < n; i++){
- if(arr[i] == x){
- found = true;
- cout << i << endl;
- break;
- }
- }
- if(not found)
- cout << "NOT FOUND" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement