• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            很簡單的題。直接按照題意模擬即可。

            /*************************************************************************
            Author: WHU_GCC
            Created Time: 2000-9-10 16:23:49
            File Name: pku1473.cpp
            Description: 
            ***********************************************************************
            */

            #include 
            <iostream>
            #include 
            <cmath>
            using namespace std;

            #define out(x) (cout << #x << ": " << x << endl)
            typedef 
            long long int64;
            const int maxint = 0x7FFFFFFF;
            const int64 maxint64 = 0x7FFFFFFFFFFFFFFFLL;
            template 
            <class T> void show(T a, int n) for (int i = 0; i < n; ++i) cout << a[i] << ' '; cout << endl; }
            template 
            <class T> void show(T a, int r, int l) for (int i = 0; i < r; ++i) show(a[i], l); cout << endl; }

            const double dx[] = {01110-1-1-1};
            const double dy[] = {110-1-1-101};
            const double inv_sqrt2 = 1.0 / sqrt(2.0);
            const double p[] = {1, inv_sqrt2, 1, inv_sqrt2, 1, inv_sqrt2, 1, inv_sqrt2};
            const char name[8][5= {"N""NE""E""SE""S""SW""W""NW"};

            int main()
            {
                
            double x = 0.0, y = 0.0;
                
            int ca = 1;
                
            while (1)
                
            {
                    
            char s[100];
                    scanf(
            "%[0-9NEWSD]", s);
                    
            if (strcmp(s, "END"== 0)
                        
            break;
                    
            char ch;
                    scanf(
            "%c"&ch);
                    
            double len = 0;
                    
            int i;
                    
            for (i = 0; s[i] >= '0' && s[i] <= '9'; i++)
                        len 
            = len * 10 + (s[i] - '0');
                    
            for (int j = 0; j < 8; j++)
                        
            if (strcmp(s + i, name[j]) == 0)
                        
            {
                            x 
            += len * dx[j] * p[j];
                            y 
            += len * dy[j] * p[j];
                        }

                    
            if (ch == '.')
                    
            {
                        printf(
            "Map #%d\n", ca++);
                        printf(
            "The treasure is located at (%.3lf,%.3lf).\n", x, y);
                        printf(
            "The distance to the treasure is %.3lf.\n\n", sqrt(x * x + y * y));
                        x 
            = y = 0.0;
                        scanf(
            "\n");
                    }
                    
                }

                
            return 0;
            }
            posted on 2007-09-10 16:58 Felicia 閱讀(375) 評論(0)  編輯 收藏 引用 所屬分類: 計算幾何
             
            伊人久久精品线影院| 亚洲国产另类久久久精品黑人| 青青国产成人久久91网| 人妻丰满?V无码久久不卡| 麻豆AV一区二区三区久久| 久久精品成人免费国产片小草| 伊人久久大香线蕉AV色婷婷色| 青青国产成人久久91网| 亚洲国产精品久久电影欧美| 99久久综合狠狠综合久久| 久久综合给合久久狠狠狠97色69| 久久久久人妻一区精品果冻| 久久久久亚洲AV成人片| 欧美亚洲另类久久综合婷婷| 久久精品国产免费| 亚洲精品国产美女久久久| 亚洲乱码日产精品a级毛片久久 | 中文精品久久久久人妻| 国产一区二区三区久久| 人妻精品久久久久中文字幕一冢本| 久久精品中文字幕第23页| 久久精品国产亚洲综合色| av无码久久久久久不卡网站| 国内精品伊人久久久久妇| 亚洲Av无码国产情品久久| 国产日韩久久久精品影院首页| 久久久久综合网久久| 久久精品国产亚洲av麻豆小说| 伊人久久综合成人网| 伊人久久大香线蕉亚洲五月天| 亚洲国产香蕉人人爽成AV片久久| 草草久久久无码国产专区| 亚洲国产成人久久综合碰碰动漫3d | 国产欧美久久久精品影院| 无码任你躁久久久久久久| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 国产欧美久久久精品| 国产一区二区精品久久| 久久99国产精品二区不卡| 日本久久久精品中文字幕| 国产成人无码精品久久久免费|