#include <stdio.h>
int leDados(FILE* arquivo, int numPalavras, char palavras[numPalavras][31]) {
for (int i = 0; i < numPalavras; i++) {
if (fscanf(arquivo
, "%30s", palavras
[i
]) == EOF
) return i
; //removeCharETornaMinuscula(palavra, '.', ',', ' ', ';', '"');
}
return 0;
}
int main(void) {
char palavras[10][31];
int numPalavras = leDados(stdin, 10, palavras);
for (int i
= 0; i
< numPalavras
; i
++) printf("%s\n", palavras
[i
]); }
//https://pt.stackoverflow.com/q/344029/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbGVEYWRvcyhGSUxFKiBhcnF1aXZvLCBpbnQgbnVtUGFsYXZyYXMsIGNoYXIgcGFsYXZyYXNbbnVtUGFsYXZyYXNdWzMxXSkgewogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1QYWxhdnJhczsgaSsrKSB7CgkgICAgaWYgKGZzY2FuZihhcnF1aXZvLCAiJTMwcyIsIHBhbGF2cmFzW2ldKSA9PSBFT0YpIHJldHVybiBpOwogICAgICAgIC8vcmVtb3ZlQ2hhckVUb3JuYU1pbnVzY3VsYShwYWxhdnJhLCAnLicsICcsJywgJyAnLCAnOycsICciJyk7Cgl9CglyZXR1cm4gMDsKfQoKaW50IG1haW4odm9pZCkgewoJY2hhciBwYWxhdnJhc1sxMF1bMzFdOwoJaW50IG51bVBhbGF2cmFzID0gbGVEYWRvcyhzdGRpbiwgMTAsIHBhbGF2cmFzKTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbnVtUGFsYXZyYXM7IGkrKykgcHJpbnRmKCIlc1xuIiwgcGFsYXZyYXNbaV0pOwp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8zNDQwMjkvMTAxCg==