WOJ1004-Noah's Ark

Now,our story begins.As usual,I'll tell you the background as follows:
6:13 And God said to Noah, The end of all flesh has come; the earth is full of their violent doings, and now I will put an end to them with the earth.
6:14 Make for yourself an ark of gopher wood with rooms in it, and make it safe from the water inside and out.
6:15 And this is the way you are to make it: it is to be three hundred cubits long, fifty cubits wide, and thirty cubits high.
6:16 You are to put a window in the ark, a cubit from the roof, and a door in the side of it, and you are to make it with a lower and second and third floors.
6:17 For truly, I will send a great flow of waters over the earth, for the destruction from under the heaven of all flesh in which is the breath of life; everything on the earth will come to an end.
6:18 But with you I will make an agreement; and you will come into the ark, you and your sons and your wife and your sons' wives with you.
6:19 And you will take with you into the ark two of every sort of living thing, and keep them safe with you; they will be male and female.
6:20 Two of every sort of bird and cattle and of every sort of living thing which goes on the earth will you take with you to keep them from destruction.
6:21 And make a store of every sort of food for yourself and them.
6:22 And all these things Noah did; as God said, so he did.

Most Hebrew scholars believe the cubit to have been 18 inches long [45.72 centimeters]. This means that the ark would have been 450 feet long [137.16 meters], 75 feet wide [22.86 meters] and 45 feet high [13.716 meters]. Noah's Ark was said to have been the largest sea going vessel ever built until the late nineteenth century when giant metal ships were first constructed. Its length to width ratio ofexactlysix to one provided excellent stability on the high seas. In fact, modern shipbuilders say it would have been almost impossible to turn over. In every way, it was admirably suited for riding out the tremendous storms in the year of the flood.


These dimensions are especially interesting when compared to those given in the mythical, Babylonian account of the Ark. Here the ark is described as a perfect cube, extending 120 cubits in all directions and with nine decks. Such a vesselwith the same length and width would spin slowly round and round in the water and from the standpoint of stability, would be a disaster.


You task is to show me stability of Noah's Ark.

输入格式

There will be multiple test cases.For each test case,there'll be three lines listing the length,width and height of the
Ark in the myth.Each line has the following form:
L meters/centimeters/inches/cubits/feet where L is a double number. Each test case will be separated by a blank line.

输出格式

For each test case,if the Ark's length to width ratio provides excellent stability,output "Excellent", else if
the Ark's length of width ratio makes it spin slowly round and round, output "Spin",else output "Neither".
Then, you must output a blank line after each test case.

样例输入

120 cubits
120 cubits
110 cubits

450 feet
22.86 meters
30 cubits

样例输出

Spin

Excellent

提示

In order to compare converted unions, you should specify a small value, for example, 1e-9.

If the difference of two double value is less than the threshhold, then you can say they are the same.


#include   
#include   
#include   
#define yz 1e-9
double hs(double a,char *c)
{        
    double k=1.0;  
    if(strcmp(c,"meters")==0)k=100.0;  
    if(strcmp(c,"cubits")==0)k=45.72;  
    if(strcmp(c,"feet")==0)k=30.48;  
    if(strcmp(c,"inches")==0)k=2.54;  
    a=a*k;  
    return a;        
}
int main()  
{           
    double length,width,height;  
    double b[2]={0.0,0.0};  
    char dlength[20],dwidth[20],dheight[20];  
    while(scanf("%lf",&length)!=EOF)  
    {  
        scanf("%s",dlength);  
        scanf("%lf",&width);  
        scanf("%s",dwidth);  
        scanf("%lf",&height);
        scanf("%s",dheight);  
        b[0]=hs(length,dlength);  
        b[1]=hs(width,dwidth);  
        if(fabs((b[0]-b[1]))


你可能感兴趣的:(WOJ)