荒天帝


私信TA

用户名:ljhabc

访问量:3316

签 名:

等  级
排  名 428
经  验 4803
参赛次数 1
文章发表 126
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<bits/stdc++.h>

#define pi 3.1415 

using namespace std;

int L, W,x, y, R,a, v, s;      

double resX, resY; 

int main() 

{

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 << fixed << setprecision(2) << resX << " " << resY << endl;

    } 

    return 0;

}


 

0.0分

0 人评分

  评论区