/**Realizzare un programma in linguaggio C che legga da un file tutte i caratteri, salvi
le vocali nel file vocali.txt e le consonanti nel file consonanti.txt**/
#include<stdio.h>
#define MAX 1000
int main()
{
    int c;
    FILE *fin, *fvoc, *fcons;
    fin = fopen("input.txt","r");
    if(fin == NULL)
    {
        printf("Non ho trovato il file");
        return 0;
    }
    fvoc =  fopen("vocali.txt","w");
    fcons =  fopen("consonanti.txt","w");
    while((c=getc(fin))!=EOF)
    {
        if(c == 'a' ||c == 'e' ||c == 'i' ||c == 'o' ||c == 'u' )
            putc(c, fvoc);
        else if(c>= 'a' && c<= 'z')
            putc(c, fcons);
    }
    fclose(fin);
    fclose(fvoc);
    fclose(fcons);
    return 0;
}

