#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>

int getline(char s[], int lim){
	int i, c;
	for (i=0; i<lim && (c=getchar()) != EOF && c != '\n'; ++i) {
		s[i] = c;
	}
	s[i] = '\0';
	return (i);
}

void buborek(float sz[], int n){
int i, j;
float  csere;

for(i=0;i<n-1;i++){
	for(j=n; j>i; j--)
	{
		if(sz[j]<sz[j-1]){
			csere=sz[j];
			sz[j]=sz[j-1];
			sz[j-1]=csere;
		}
	}
}
}

int ell(char s[]){
int i=0, ok=1, h=0, db=0;
float n=0;	

while(isspace(s[i])){
	i++;}


if(s[i]!='+' && s[i]!='-' && !isdigit(s[i])){ok=0;}
else{
if(isdigit(s[i])){db++;}
i++;}



while(isdigit(s[i])){
i++;
db++;
}

if(db==0){ok=0;}

if(s[i]!='.'){ok=0;}

i++;
db=0;

while(isdigit(s[i])){
i++;
db++;
}

if(db==0){ok=0;}

if(s[i]!='\0'){ok=0;}

if(ok==1){
n=atof(s);
	if(n<=10 || n>=20){ok=0;}
}
	
return ok;
}



void main(void){
char s[128];
float sz[3];
int ok=1, db=0, i=0;

do{
do{
printf("Adja meg az %d. szamot:\n",db+1);
getline(s,128);

if(ell(s)){ok=1; 
sz[db]=atof(s);
db++;
}
else{ok=0; printf("NEM JO");}

}while(ok!=1);
}while(db!=4);


buborek(sz,db-1);

for(i=0;i<4;i++){
	printf("%0.2f    ",sz[i]);
}
}
	

