#include <stdio.h>

typedef struct teszt_t {
    float kerdes;
    int	  valasz;
} teszt_t;

teszt_t teszt[] = {
    {   0.3, 1 },
    {   1.5, 2 },
    {  10.1, 3 },
    {  30.7, 4 },
    {  50.0, 5 },
    {  80.3, 6 },
    { 100.4, 7 },
    { 150.1, 8 },
    { 180.3, 9 },
    { 200.8, 10 },
    { 270.2, 11 },
    { 300.3, 12 },
    { 510.1, 13 }
};


#define TMERET ( sizeof(teszt) / sizeof(teszt[0]) )
#define DBG ++dbgCnt,

int main() 
{
    int i;

    printf("Teszt Binary Tree\n\n");

    for ( i = 0; i < TMERET; i++ ) {
        float szam = teszt[i].kerdes;
        int dbgCnt = 0;

        if ( DBG szam < 105.4 ) {
            if ( DBG szam < 35.7 ) {
                if ( DBG szam < 5.5 ) {
                    if ( DBG szam < 0.5 ) {
                        printf( "Szam 0: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                    else {
                        printf( "Szam 1: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                }
                else {
                    if ( DBG szam < 20 ) {
                        printf( "Szam 10: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                    else {
                        printf( "Szam 30: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                }
            }
            else {
                if ( DBG szam < 55.0 ) {
                    printf( "Szam 50: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                }
                else {
                    if ( DBG szam < 85.2 ) {
                        printf( "Szam 80: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                    else {
                        printf( "Szam 100: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                    }
                }
            }
        }
        else if ( DBG szam < 205.8 ) {
            if ( DBG szam < 155.3 ) {
                printf( "Szam 150: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
            }
            else {
                if ( DBG szam < 185.3 ) {
                    printf( "Szam 180: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                }
                else {
                    printf( "Szam 200: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
                }
            }
        }
        else if ( DBG szam < 305.3 ) {
            if ( DBG szam < 275.2 ) {
                printf( "Szam 270: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
            }
            else {
                printf( "Szam 300: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
            }
        }
        else {
            printf( "Szam 500: %i / k:%f / c:%i\n", teszt[i].valasz, szam, dbgCnt);
        }
    }

    return 0;
}


/*

tamas@tamas-inf:~$ ./test_binaryTree 
Teszt Binary Tree

Szam 0: 1 / k:0.300000 / c:4
Szam 1: 2 / k:1.500000 / c:4
Szam 10: 3 / k:10.100000 / c:4
Szam 30: 4 / k:30.700001 / c:4
Szam 50: 5 / k:50.000000 / c:3
Szam 80: 6 / k:80.300003 / c:4
Szam 100: 7 / k:100.400002 / c:4
Szam 150: 8 / k:150.100006 / c:3
Szam 180: 9 / k:180.300003 / c:4
Szam 200: 10 / k:200.800003 / c:4
Szam 270: 11 / k:270.200012 / c:4
Szam 300: 12 / k:300.299988 / c:4
Szam 500: 13 / k:510.100006 / c:3


*/


