Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: iAOMNC

Problemset: Maximum Adjacent

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-10 11:33:10

#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a;
a.push_back(INT_MIN);
int i=0;
string b;
while(1>0)
{
cin >> b;

if(b[0]>='A')
{
break;
}
else
{
int k=stoi(b);
a.push_back(k);
}
i++;
}
a.push_back(INT_MIN);
for(int y=1;y<=i;y++)
{

if(a[y+1]<a[y]&&a[y-1]<a[y])
{
cout << a[y]<<" ";
}
}

}