C оператор if не печатает вывод - PullRequest
0 голосов
/ 24 марта 2020

Извините, если об этом спрашивали много раз. Я начинающий программист, и я должен найти самые холодные и самые теплые общие температуры группы озер. Мои операторы "if" не выводят вывод. Мне было интересно, почему это может быть? Любая помощь очень ценится. Спасибо.

void
overallColdestWarmest()
{
    printf("\n----- PART FOUR -----\n");

    double a1, b1, c1, d1, e1, f1;

    a1 = temp[0][(int)entries[0][0]];
    b1 = temp[1][(int)entries[1][0]];
    c1 = temp[2][(int)entries[2][0]];
    d1 = temp[3][(int)entries[3][0]];
    e1 = temp[4][(int)entries[4][0]];
    f1 = temp[5][(int)entries[5][0]];

    if(a1 < b1 && a1 < c1 && a1 < d1 && a1 < e1 && a1 < f1)
    {
        printf("Lake Superior has the overall coldest temp of %.2lf on .\n", a1);
        date(entries[0][0]);
    }
    else
    {
        if(b1 < a1 && b1 < c1 && b1 < d1 && b1 < e1 && b1 < f1)
        {
            printf("Lake Michigan has the overall coldest temp of %.2lf on .\n", b1);
            date(entries[1][0]);
        }
        else
        {
            if(c1 < a1 && c1 < b1 && c1 < d1 && c1 < e1 && c1 < f1)
            {
                printf("Lake Huron has the overall coldest temp of %.2lf on .\n", c1);
                date(entries[2][0]);
            }
            else
            {
                if(d1 < a1 && d1 < b1 && d1 < c1 && d1 < e1 && d1 < f1)
                {
                    printf("Lake Erie has the overall coldest temp of %.2lf on .\n", d1);
                    date(entries[3][0]);
                }
                else
                {
                    if(e1 < a1 && e1 < b1 && e1 < c1 && e1 < d1 && e1 < f1)
                    {
                        printf("Lake Ontario has the overall coldest temp of %.2lf on .\n", e1);
                        date(entries[4][0]);
                    }
                    else
                    {
                        if(f1 < a1 && f1 < b1 && f1 < c1 && f1 < d1 && f1 < e1)
                        {
                            printf("Lake St. Clair has the overall coldest temp of %.2lf on .\n", f1);
                            date(entries[5][0]);
                        }
                    }
                }
            }
        }
    }
}
...