fork download
  1. #include<math.h>
  2. #include<stdio.h>
  3.  
  4. struct {
  5. double x;
  6. double y;
  7. } a={1,1},b={0.0};
  8.  
  9. int main(void){
  10. double len;
  11. len = sqrt( (b.x - a.x)*(b.x - a.x) + (b.y - a.y)*(b.y - a.y) );
  12. printf("点 a と点 b を結ぶ線分の長さ: %lf¥n", len );
  13. return 0;
  14. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
点 a と点 b を結ぶ線分の長さ: 1.414214¥n