#include <stdio.h>
int main() {
//o DirecaoLast é só para determinar o final
typedef enum direcao { Norte, Sul, Leste, Oeste, DirecaoLast } Direcao;
const char* DirecaoNames[] = { "Norte", "Sul", "Leste", "Oeste" };
for (int i = 0; i < DirecaoLast; i++) {
Direcao direcao = i;
printf("%s = %d\n", DirecaoNames
[i
], direcao
); }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKCS8vbyBEaXJlY2FvTGFzdCDDqSBzw7MgcGFyYSBkZXRlcm1pbmFyIG8gZmluYWwKICAgIHR5cGVkZWYgZW51bSBkaXJlY2FvIHsgTm9ydGUsIFN1bCwgTGVzdGUsIE9lc3RlLCBEaXJlY2FvTGFzdCB9IERpcmVjYW87CiAgICBjb25zdCBjaGFyKiBEaXJlY2FvTmFtZXNbXSA9IHsgIk5vcnRlIiwgIlN1bCIsICJMZXN0ZSIsICJPZXN0ZSIgfTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgRGlyZWNhb0xhc3Q7IGkrKykgewogICAgICAgIERpcmVjYW8gZGlyZWNhbyA9IGk7CiAgICAgICAgcHJpbnRmKCIlcyA9ICVkXG4iLCBEaXJlY2FvTmFtZXNbaV0sIGRpcmVjYW8pOwogICAgfQp9