fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4. #include <stack>
  5. #include <vector>
  6. #include <algorithm>
  7. #include <queue>
  8. #include <list>
  9. #include <map>
  10. #include <string>
  11. #include <cstdlib>
  12. #include <iomanip>
  13.  
  14. using namespace std;
  15.  
  16. int main(){
  17. long long x1,y1,x2,y2;
  18. cin>>x1>>y1>>x2>>y2;
  19. y2=-y2;
  20.  
  21. long long cur1=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
  22. printf("%lld.00000000000000000000", cur1);
  23. cin.get();
  24. cin.get();
  25. return 0;
  26. };
  27.  
Success #stdin #stdout 0s 3144KB
stdin
0 1 2 1
stdout
8.00000000000000000000