printf Enter how many strings you want to sort scanf kol while kol pri

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
printf("Enter, how many strings you want to sort.\n");
scanf("%d",&kol);
while(kol>0)
{
printf("Enter number of string which you want to sort\n");
scanf("%d",&stroka);
for(i=stroka;flag==1;){
flag=0;
for(j=0;j<stolb-1;j++){
if(*(mas+i*stolb+j)>*(mas+i*stolb+(j+1))){
temp=*(mas+i*stolb+j);
*(mas+i*stolb+j)=*(mas+i*stolb+(j+1));
*(mas+i*stolb+(j+1))=temp;
flag=1;
}
}
}
kol--;
}