现在有一张半径为r的圆桌,其中心位于(x,y),现在他想把圆桌的中心移到(x1,y1)。每次移动一步,都必须在圆桌边缘固定一个点然后将圆桌绕这个点旋转。问最少需要移动几步。

// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。
//

include "stdafx.h"

include

include

include

include

using namespace std;

int main()
{
double r, x, y, x1, y1;
while (cin >> r >> x >> y >> x1 >> y1)
{
double len = sqrt((x1 - x)(x1 - x) + (y1 - y)(y1 - y));
int num = ceil(len / (2 * r));
cout << num << endl;
}
return 0;
}

posted @ 2017-03-07 15:48  wdan2016  阅读(405)  评论(0)    收藏  举报