#include <stdio.h>
int main(void) {
char nome[30];
int i;
for (i = 0; nome[i] != '\0'; i++) { //sem strlen que seria péssimo
if (nome[i] < 'a' || nome[i] > 'z') { //lógica mais adequada
break; //encerra o laço, não tem porque continuar, achou algo que não muda mais
}
}
if (nome
[i
] != '\0') printf("Tem caracteres inválidos"); //se não chegou ao fim }
//https://pt.stackoverflow.com/q/219389/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CgljaGFyIG5vbWVbMzBdOwoJc2NhbmYoIiVzIiwgbm9tZSk7CglpbnQgaTsKCWZvciAoaSA9IDA7IG5vbWVbaV0gIT0gJ1wwJzsgaSsrKSB7IC8vc2VtIHN0cmxlbiBxdWUgc2VyaWEgcMOpc3NpbW8KCSAgICBpZiAobm9tZVtpXSA8ICdhJyB8fCBub21lW2ldID4gJ3onKSB7IC8vbMOzZ2ljYSBtYWlzIGFkZXF1YWRhCgkgICAgICAgIGJyZWFrOyAvL2VuY2VycmEgbyBsYcOnbywgbsOjbyB0ZW0gcG9ycXVlIGNvbnRpbnVhciwgYWNob3UgYWxnbyBxdWUgbsOjbyBtdWRhIG1haXMKCSAgICB9Cgl9CglpZiAobm9tZVtpXSAhPSAnXDAnKSBwcmludGYoIlRlbSBjYXJhY3RlcmVzIGludsOhbGlkb3MiKTsgLy9zZSBuw6NvIGNoZWdvdSBhbyBmaW0KfQoKLy9odHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMjE5Mzg5LzEwMQ==