S003-AC.cc
449 Bytes
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a,b;
cin >> a;
if(a < 1)
{
cout << "Incorrect position." << endl;
return 0;
}
for(int i = 1; i < a; i++)
{
cin >> b;
if(b == -1)
{
cout << "Incorrect position." << endl;
return 0;
}
}
cin >> b;
if(b == -1)
{
cout << "Incorrect position." << endl;
return 0;
}
cout << "At the position " << a << " there is a(n) " << b << "." << endl;
}