提交时间:2019-12-07 15:10:07

运行 ID: 2872

#include <iostream> using namespace std; int main() { int n = 0; cin >> n; int arr[100] = { 0 }; for (int i = 0;i<n;i++) //for循环用来存储 { cin >> arr[i]; } for (int i = 0; i < n; i++) //for循环用来遍历查找 { if (arr[i] == i) { cout << i << endl; return 0; } } cout << "N" << endl; return 0; }