이모저모
14583 본문
그림을 잘못그려서 ㅜㅜ
cos, sin을 이용하면 쉽게 구할 수 잇다.
#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
#define MOD 1000000007
#define INF 2147483647
#define LNF 9223372036854775807
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
float h,v;
int main () {
freopen("sample.txt", "r", stdin);
scanf("%f%f",&h,&v);
float a,b,c,d,e;
a = sqrt(h*h+v*v);
b = (a-h)*h/v;
c = sqrt(h*h+b*b);
d = h/c;
e = (v-b)*d;
printf("%.2f %.2f\n",c/2.,e);
return 0;
}
Comments