李明毓


私信TA

用户名:dotcpp0675416

访问量:648

签 名:

低调发育

等  级
排  名 9847
经  验 1069
参赛次数 0
文章发表 10
年  龄 0
在职情况 学生
学  校 河南开封科技传媒学院
专  业

  自我简介:

TA的其他文章

DNA(加油)
浏览:40

解题思路:

注意事项:acos(-1)=π,数学要学好啊!

参考代码:

#include

#include

#include

using namespace std;

 

int main() 

{

    int L, W;          

    int x, y, R;      

    int a, v, s;       

    double resX, resY; 

    while (cin >> L >> W >> x >> y >> R >> a >> v >> s) {

        if (!L) 

        {

            break; 

        }

        L -= 2 * R;

        W -= 2 * R;

        x -= R;

        y -= R;

        double arc = a * acos(-1) / 180; 

        double length = fabs(x + v * s * cos(arc));

        double width = fabs(y + v * s * sin(arc));

        while (length > 2 * L ) 

            {

            length -= 2 * L;

        }

        while (width > 2 * W) 

            {

            width -= 2 * W;

        }

        if (length <= L) 

            {

            resX = length + R;

        } 

        else {

            resX = 2 * L - length + R;

        }

        if (width <= W) 

            {

            resY = width + R;

        }

        else

         {

            resY = 2 * W - width + R;

        }

        cout << setiosflags(ios::fixed )<< setprecision(2) << resX << " " << resY << endl;

    } 

    return 0;

}


 

0.0分

2 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区