Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- struct triangle{
- int x;
- int y;
- };
- int main(int argc, char** argv) {
- int n;
- cin >> n;
- triangle tab[n];
- for (int i =0 ; i<n ; i++){
- cin >> tab[i].x >> tab[i].y;
- }
- for (int i=0; i<n; i++){
- if (tab[i].x>tab[i].y) {
- double temp=asin(tab[i].y/(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y)));
- cout << ceil(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y))<< " "<< round(temp*180/3.14)<<endl;
- }
- else {
- double temp=asin(tab[i].x/(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y)));
- cout << ceil(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y))<< " "<< round(temp*180/3.14)<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement