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

int getline(char s[], int n){
int i,c;

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



int lebege(char s[])
{

int ok=1,i=1,h,db=0, b=-100;
float k=0;

h=strlen(s);

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

if(i!=h) {

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

i++;

while(isdigit(s[i])) {i++; db++;}
if(db==0){ok=0;}

if(i!=h) {ok=0;}
}

}
if(ok==1){
(float) k=(float) atof(s);

if(b>k || k >100){ok=0;}
else{ok=1;}

}
return ok;
}


void main(void)
{
int db=0, ok=1, i=0, h=0, maxi=0, mini=0; 
float n=0;
char s[128];
float min=0, max=0;


printf("Adja meg a napi homersekletet orankent!\n");
printf("Enterig adhat meg adatokat, de max 24-et\n");

do{
do{
printf("Adja meg %d orai homersekletet:\n", db);

h=getline(s,128);
if(h>0){

if(lebege(s)){ok=1;}
else{ok=0; printf("Nem jo\n");}

if(ok==1){
(float) n=(float) atof(s);

if(n>max){max=n; maxi=db;}
/*if(n<-100 && n*/

db++;}
}

}while(ok!=1);
}while(db!=24 || h!=0);

printf("%d. ora max:%0.2f",maxi, max);

}