This commit is contained in:
Павел Родионов
2025-11-13 18:21:23 +07:00
parent e266a25b45
commit 2fca7b75f5
28 changed files with 74 additions and 4 deletions
+30
View File
@@ -0,0 +1,30 @@
#include <stdio.h>
void scale(double *a, double *b, double *c);
int main() {
double a,b,c;
printf("Print: num1 num2 num3\nPrint: ");
scanf(" %lf %lf %lf",&a,&b,&c);
scale(&a,&b,&c);
printf("%lf > %lf > %lf",a,b,c);
return 0;
}
void scale(double *a, double *b, double *c){
double result[3];
result[0] = *a;
result[1] = *b;
result[2] = *c;
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 2 - i; ++j) {
if (result[j] < result[j + 1]) {
double tmp = result[j];
result[j] = result[j + 1];
result[j + 1] = tmp;
}
}
}
*a = result[0];
*b = result[1];
*c = result[2];
}