#include <string.h>
#include <stdio.h>
void ler_string(char* destino, size_t tamanho_leitura){
fgets(destino
, tamanho_leitura
, stdin
); size_t ultima_pos
= strlen(destino
) - 1; if (destino[ultima_pos] == '\n'){
destino[ultima_pos] = '\0';
}
}
int main(){
char username[25];
char passwd[45];
ler_string(username, 25);
printf("Input your password->"); ler_string(passwd, 45);
char query[128];
sprintf(query
,"select username, password from accounts where username='%s' and password='%s'\n", username
, passwd
);
return 0;
}
I2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCnZvaWQgbGVyX3N0cmluZyhjaGFyKiBkZXN0aW5vLCBzaXplX3QgdGFtYW5ob19sZWl0dXJhKXsKICAgIGZnZXRzKGRlc3Rpbm8sIHRhbWFuaG9fbGVpdHVyYSwgc3RkaW4pOwogICAgc2l6ZV90IHVsdGltYV9wb3MgPSBzdHJsZW4oZGVzdGlubykgLSAxOwogICAgaWYgKGRlc3Rpbm9bdWx0aW1hX3Bvc10gPT0gJ1xuJyl7CiAgICAgICAgZGVzdGlub1t1bHRpbWFfcG9zXSA9ICdcMCc7CiAgICB9Cn0KCmludCBtYWluKCl7CgogICAgY2hhciB1c2VybmFtZVsyNV07CiAgICBjaGFyIHBhc3N3ZFs0NV07CgogICAgcHJpbnRmKCJJbnB1dCB5b3VyIG5hbWUgLT4iKTsKICAgIGxlcl9zdHJpbmcodXNlcm5hbWUsIDI1KTsKCiAgICBwcmludGYoIklucHV0IHlvdXIgcGFzc3dvcmQtPiIpOwogICAgbGVyX3N0cmluZyhwYXNzd2QsIDQ1KTsKCiAgICBjaGFyIHF1ZXJ5WzEyOF07CiAgICBzcHJpbnRmKHF1ZXJ5LCJzZWxlY3QgdXNlcm5hbWUsIHBhc3N3b3JkIGZyb20gYWNjb3VudHMgd2hlcmUgdXNlcm5hbWU9JyVzJyBhbmQgcGFzc3dvcmQ9JyVzJ1xuIiwgdXNlcm5hbWUsIHBhc3N3ZCk7CiAgICBwcmludGYoIiVzIiwgcXVlcnkpOwoKICAgIHJldHVybiAwOwp9Cg==