Problem ----------------------------------------------------
#include<stdio.h>
int main()
{
long int n,p,a,b,c,mid,ary[10000],q,temp,ptr,k;
scanf("%ld",&n);
if(n<20)
{
for(p=1;p<=n;p++)
{
scanf("%ld%ld%ld",&a,&b,&c);
if((a>=1000&&a<=10000)&&(b>=1000&&b<=10000)&&(c>=1000&&a<=10000))
{
ary[1]=a;
ary[2]=b;
ary[3]=c;
for(k=1;k<=3;k++)
{
ptr=1;
while(ptr<=3-k)
{
if(ary[ptr]>ary[ptr+1])
{
temp=ary[ptr];
ary[ptr]=ary[ptr+1];
ary[ptr+1]=temp;
}
ptr=ptr+1;
}
}
printf("Case %ld: %ld\n",p,ary[2]);
}
}
}
return 0;
}
No comments:
Post a Comment