Advertisement
Guest User

Untitled

a guest
Nov 25th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "stdafx.h"
  3. #include "math.h"
  4.  
  5. void calc(float *, float *, float *, float *, float *, float *, float *, float *);
  6.  
  7. void main()
  8. {
  9.     float x, x1, y, y1, z, z1, V, S;
  10.     printf("Input x, x1, y, y1, z, z1 \n");
  11.     scanf_s("%f %f %f %f %f %f", &x, &x1, &y, &y1, &z, &z1);
  12.     calc(&x, &x1, &y, &y1, &z, &z1, &V, &S);
  13.     printf("V = %f; S = %f \n", &V, &S);
  14. }
  15.  
  16. void calc(float &x, float &x1, float &y, float &y1, float &z, float &z1, float &V, float &S)
  17. {  
  18.     float a = sqrt(pow(x-x1, 2)+pow(y-y1, 2)+pow(z-z1, 2));
  19.     V = pow(a, 3); S = pow(a, 2);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement