Herowaree

1039

Dec 1st, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int flower_radius, flower_x, flower_y, circle_x, circle_y, circle_radius;
  7.  
  8. circle_radius = 3;
  9. circle_x = 0;
  10. circle_y = 0;
  11.  
  12. flower_radius = 4;
  13. flower_x = 0;
  14. flower_y = 0;
  15.  
  16. double distance = sqrt( pow(circle_x - flower_x, 2) + pow(circle_y - flower_y, 2) );
  17. if ( circle_radius >= (distance + flower_radius) ){
  18. printf("Vivo\n");
  19. }else{
  20. printf("Morto\n");
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment