#include<stdio.h>
int main()
{
int a,b,temp,t;
scanf("%d%d",&a,&b);
if(a<b)
{
t=a;
a=b;
b=t;
}
scanf("%d",&temp);
while(temp!=-1)
{
if(temp<b)
scanf("%d",&temp);
else if(temp>b)
{
b=temp;
scanf("%d",&temp);
}
if(a<b)
{
t=a;
a=b;
b=t;
}
}
printf("%d",b);
return 0;
}
int main()
{
int a,b,temp,t;
scanf("%d%d",&a,&b);
if(a<b)
{
t=a;
a=b;
b=t;
}
scanf("%d",&temp);
while(temp!=-1)
{
if(temp<b)
scanf("%d",&temp);
else if(temp>b)
{
b=temp;
scanf("%d",&temp);
}
if(a<b)
{
t=a;
a=b;
b=t;
}
}
printf("%d",b);
return 0;
}
No comments:
Post a Comment