Răspuns :
char x [10000], y [10000]; //Alege dimensiunea
int i=0;
while (f>>x[k++])
{
if ((x [k]>='a'&&x [k]<='z')||(x [k]>='A'&&x [k]<='Z'))
y [i++]=x[k];
else
i++;
}
Altcumva nu poti.. atata timp cat nu stii numarul de cuvinte, doar daca iti cere intr-o problema de eficienta atunci te folosesti strict de variabile sau vectori de ponderi.
int i=0;
while (f>>x[k++])
{
if ((x [k]>='a'&&x [k]<='z')||(x [k]>='A'&&x [k]<='Z'))
y [i++]=x[k];
else
i++;
}
Altcumva nu poti.. atata timp cat nu stii numarul de cuvinte, doar daca iti cere intr-o problema de eficienta atunci te folosesti strict de variabile sau vectori de ponderi.