csansoon

P4.02 X04437 Distancia al origen

Oct 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. double dist_or(double x, double y) {
  6.     x=pow(((x*x)+(y*y)),0.5);
  7.     return x;
  8. }
  9.  
  10. int main(){
  11.     double d1, d2;
  12.     cin >> d1 >> d2;
  13.     cout << dist_or(d1,d2) << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment