Skip to content
Snippets Groups Projects
Commit fc9999e0 authored by Mikołaj Suszek's avatar Mikołaj Suszek
Browse files

Replace jezykc12.c

parent 17c18176
Branches
No related merge requests found
......@@ -3,20 +3,17 @@
#include <math.h>
int main () {
float wartosc, m, v1, v2, v3;
float wartosc, m=0, v1=0, v2=0, v3=0;
printf("podaj mase i 3 skladowe wektrora v\n");
scanf("%f %f, %f, %f", &m, &v1, &v2, &v3);
int ped [3] = {m*v1, m*v2, m*v3};
scanf("%f %f %f %f", &m, &v1, &v2, &v3);
int ped [3] = {(m*v1), (m*v2), (m*v3)};
for (int i=0; i<3; i++){
printf("\n skladowe wektora pedu to:\n %i", ped[i]);
}
for (int i = 0; i<3; i++){
printf("%i ", ped[i]);
printf("\n skladowe wektora pedu to:\n %d", ped[i]);
}
wartosc=sqrtf(ped[0]*ped[0]+ped[1]*ped[1]+ped[2]*ped[2]);
printf("\n Wartosc wektora pedu to:\n %.2f", wartosc);
return 0;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment