#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main( ) {
char user[ 20 ] ;
int senha, contador = 0 ;
do {
printf ( "Entre com o usuario: " ) ; printf ( "Entre com a senha: " ) ; // aqui as credenciais estão corretas
if ( ! strcmp ( user
, "leonardo" ) && senha
== 123 ) { printf ( "\n Acesso concedido.\n " ) ; break ;
}
contador++;
} while ( contador < 3 ) ;
if ( contador == 3 ) {
printf ( "Limite de tentativas alcancadas.\n " ) ; }
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKaW50IG1haW4oKSB7CiAgICBjaGFyIHVzZXJbMjBdOwogICAgaW50IHNlbmhhLCBjb250YWRvciA9IDA7CiAgICBkbyB7CiAgICAgICAgcHJpbnRmKCJFbnRyZSBjb20gbyB1c3VhcmlvOiAiKTsKICAgICAgICBzY2FuZigiJXMiLCB1c2VyKTsKICAgICAgICBwcmludGYoIkVudHJlIGNvbSBhIHNlbmhhOiAiKTsKICAgICAgICBzY2FuZigiJWQiLCAmc2VuaGEpOwogICAgICAgIC8vIGFxdWkgYXMgY3JlZGVuY2lhaXMgZXN0w6NvIGNvcnJldGFzCiAgICAgICAgaWYgKCFzdHJjbXAodXNlciwgImxlb25hcmRvIikgJiYgc2VuaGEgPT0gMTIzKSB7CiAgICAgICAgICAgIHByaW50ZigiXG5BY2Vzc28gY29uY2VkaWRvLlxuIik7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBjb250YWRvcisrOwogICAgICAgIHByaW50ZigiJXMiLCB1c2VyKTsKICAgIH0gd2hpbGUgKGNvbnRhZG9yIDwgMyk7CiAgICBpZiAoY29udGFkb3IgPT0gMykgewogICAgICAgIHByaW50ZigiTGltaXRlIGRlIHRlbnRhdGl2YXMgYWxjYW5jYWRhcy5cbiIpOwogICAgfQogICAgcHJpbnRmKCJGaW0uXG4iKTsKICAgIHJldHVybiAwOwp9