Blame view

P65103_en/S002-AC.cc 358 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int a,b,i=1;
	cin >> a;
	if(a < 1)
	{
		cout << "Incorrect position." << endl;
		return 0;
	}
	while(cin >> b)
	{
		if(i++ == a)
		{
			cout << "At the position " << a << " there is a(n) " << b << "." << endl;
			return 0;
		}
	}
	cout << "Incorrect position." << endl;
	return 0;
}