Wyswietlanie ilości małych i dużych liter.

0

Mam problem z programem, który za zadanie ma policzenie ilości dużych i małych liter. Mam coś takiego:

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

int main(void)
{
	char a;
	int duze = 0;
	int male = 0;

	printf("Podaj dane wejsciowe\n");
	while ((a = getchar()) != EOF)
	{
		if (isalpha(a) == 1)
		{
			if (islower(a) == 1)
				male++;
			else 
				duze++;
		}
	}
	printf("Liczba duzych liter wynosi %d a malych %d", duze, male);
	getchar();
	return 0;
}

Niestety program w ogóle nie liczy małych liter. Zawsze w wyniku dostaje 0 małych liter.

1
#include <stdio.h>
#include <ctype.h>

int main()
{
    char a;
    int duze = 0;
    int male = 0;
    printf("Podaj dane wejsciowe\n");
    while (scanf("%c", &a) != EOF)
    {
        if(isupper(a))
            duze++;
        else if(islower(a))
            male++;
    }
    printf("Liczba duzych liter wynosi %d a malych %d", duze, male);
    return 0;
}

1 użytkowników online, w tym zalogowanych: 0, gości: 1