include stdio include stdlib include locale void sort double temp int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
void sort(){
double temp;
int i, j;
for(i=0; i<3; i++){
for(j = 2; j > i; j--){
if(a[i][j]>a[i][j+1]){
temp = a[i][j];
a[i][j] = a[i][j+1];
a[i][j+1]=temp;
}
}
}
for(i=0; i<3; i++){
printf("%lf ", *(a+i));
}
}
int main(void){
double a[30];
int i , j;
setlocale(LC_CTYPE,"Russian");
puts("Введите числа");
for(i=0;i<9;i++)
scanf("%lf",&a[i]);
sort(a[3]);
system("PAUSE");
return 0;
}