Advertisement
Guest User

Trójkąt

a guest
Nov 23rd, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. struct triangle{
  5. int x;
  6. int y;
  7. };
  8. int main(int argc, char** argv) {
  9. int n;
  10. cin >> n;
  11. triangle tab[n];
  12. for (int i =0 ; i<n ; i++){
  13. cin >> tab[i].x >> tab[i].y;
  14. }
  15.  
  16. for (int i=0; i<n; i++){
  17. if (tab[i].x>tab[i].y) {
  18. double temp=asin(tab[i].y/(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y)));
  19. cout << ceil(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y))<< " "<< round(temp*180/3.14)<<endl;
  20. }
  21. else {
  22. double temp=asin(tab[i].x/(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y)));
  23. cout << ceil(sqrt(tab[i].x*tab[i].x+tab[i].y*tab[i].y))<< " "<< round(temp*180/3.14)<<endl;
  24. }
  25. }
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement