C # - 170
using System.Linq;class P{static void Main(string[]a){System.Console.Write(string.Join(",",System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)))));}}
Formatado:
using System.Linq;
class P
{
static void Main(string[] a) {
System.Console.Write(
string.Join(",", System.IO.File.ReadAllLines(a[0])
.Where(w => "aeiouy".All(c => w.Contains(c)))));
}
}
Agora não está com disposição para implementar a contagem, mas deve ser fácil.
O caminho para a (versão em minúscula da) lista de palavras deve ser passado ao programa como primeiro argumento:
program.exe D:\foo\bar\corncob_lowercase.txt
Saída:
abstemiously,authoritatively,behaviourally,consequentially,counterrevolutionary,
disadvantageously,educationally,encouragingly,eukaryotic,evolutionarily,evolutio
nary,exclusionary,facetiously,gregariously,heterosexuality,homosexuality,importu
nately,inconsequentially,instantaneously,insurrectionary,intravenously,manoeuvra
bility,neurologically,neurotically,ostentatiously,pertinaciously,precariously,pr
ecautionary,questionably,revolutionary,simultaneously,supersonically,tenaciously
,uncomplimentary,uncontroversially,unconventionally,undemocratically,unemotional
ly,unequivocally,uninformatively,unintentionally,unquestionably,unrecognisably
Tomei a liberdade de produzir e separar vírgulas; nenhum dos quais está especificado nas regras (qual estado "deve encontrar todas as palavras", não como (e SE) como saída).
Incluindo contagem (+ saída): 192 - 5 = 187
using System.Linq;class P{static void Main(string[]a){var r=System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)));System.Console.Write(string.Join(",",r)+" "+r.Count());}}
Saída:
abstemiously,authoritatively,behaviourally,consequentially,counterrevolutionary,
disadvantageously,educationally,encouragingly,eukaryotic,evolutionarily,evolutio
nary,exclusionary,facetiously,gregariously,heterosexuality,homosexuality,importu
nately,inconsequentially,instantaneously,insurrectionary,intravenously,manoeuvra
bility,neurologically,neurotically,ostentatiously,pertinaciously,precariously,pr
ecautionary,questionably,revolutionary,simultaneously,supersonically,tenaciously
,uncomplimentary,uncontroversially,unconventionally,undemocratically,unemotional
ly,unequivocally,uninformatively,unintentionally,unquestionably,unrecognisably 4
3
(Observe a contagem no final: 43)
Nenhuma saída ("deve encontrar todas as palavras"): 137 - 5 = 132
using System.Linq;class P{static void Main(string[]a){var r=System.IO.File.ReadAllLines(a[0]).Where(w=>"aeiouy".All(c=>w.Contains(c)));}}
(Dobra as regras um bit e depois novamente: não realmente) Isso localiza todas as palavras e a contagem está disponível executando r.Count()
.