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() {
- int n ;
- cin>>n;
- int arr[n];
- for(int i=0 ;i<n ;i++)
- {
- cin>>arr[i];
- }
- bool ch=0;
- int m;
- for(int i=0 ; i<n ; i++)
- {
- if (i%10==arr[i])
- {
- ch=1;
- m=i;
- break ;
- }
- }
- if (ch ==1)
- cout<<m<<endl;
- else
- cout<<-1<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement