Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "stdio.h"
- #include "math.h"
- void calc(float &, float &, float &, float &, float &, float &, float &, float &);
- void main()
- {
- float x, x1, y, y1, z, z1, V, S;
- printf("Input x, x1, y, y1, z, z1 \n");
- scanf_s("%f %f %f %f %f %f", &x, &x1, &y, &y1, &z, &z1);
- calc(x, x1, y, y1, z, z1, V, S);
- printf("V = %f; S = %f \n", &V, &S);
- }
- void calc(float &x, float &x1, float &y, float &y1, float &z, float &z1, float &S, float &V)
- {
- float a = sqrt(pow(x-x1, 2)+pow(y-y1, 2)+pow(z-z1, 2));
- V = pow(a,3); S = pow(a, 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement