HEU 4049 Frame Polygonal Line

 1 /**************************************
 2Problem: HEU 4049 Frame Polygonal Line
 3Time: 0.0010 s
 4Memory: 240 k 
 5Accepted Time: 2009-04-07 11:55:46
 6Tips: 
 7**************************************/

 8 #include  < stdio.h >
 9 int  main()
10 {
11    long a1,a2,a3,a4,t1,t2;
12    while(1)
13    {
14        scanf("%ld%ld",&t1,&t2);
15        if(t1==0&&t2==0)break;
16        else
17        {
18            a1=a3=t1;
19            a2=a4=t2;
20            while(1)
21            {
22                scanf("%ld%ld",&t1,&t2);
23                if(t1==0&&t2==0)break;
24                if(a1>t1)a1=t1;
25                if(a3<t1)a3=t1;
26                if(a2>t2)a2=t2;
27                if(a4<t2)a4=t2;
28            }

29            printf("%ld %ld %ld %ld\n",a1,a2,a3,a4);
30        }

31    }

32    return 0;
33}

34

你可能感兴趣的:(frame)