백준
4706 쌍둥이 역설
불타는강정
2020. 7. 29. 20:45
식은 쉬웠는데 자꾸 답이 안 나와서 왜지??? 왜지??? 더블 터졌나??? 싶었는데 알고보니 광속이라 속도 나눠줘야 한다.
더블 자료형 찾아보다가 최댓값이 10의 308승이라는 거 듣고 이제 값 크면 더블로 써도 되지 않을까 싶었는데 정밀도랑 반비례 관계여서 의미가 읍다.. ㅠ 아쉽
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#define xx first
#define yy second
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = long long;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int main() {
double a, b;
double c = 299792458;
while (cin >> a >> b)
{
if (a == 0 && b == 0)
break ;
double tmp = 1 - (b/a)*(b/a);
printf("%.3lf\n", sqrt(tmp));
}
return 0;
}