Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int pos,n;
- while (cin>>pos) {
- int digits=0,pos2=pos;
- for (pos2; pos2!=0; pos2--) {
- cin>>n;
- if (n==-1) break;
- digits++;
- }
- if (pos2==0) {
- int m;
- while (cin>>m&&m!=-1) {}
- }
- if (pos2>0||pos<=0) cout<<"Incorrect position."<<endl;
- else cout<<"At the position "<<pos<<" there is a(n) "<<n<<"."<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment