Conta = { balance = 0 }
Contas = { }
Senhas = { }
Inicial = 5000
function Conta: withdraw ( v)
Conta. Balance = Conta. Balance - v
end
function Login( )
io.write ( "Digite seu Usuario\n " )
usuariol = io.read ( )
io.write ( "Digite sua senha\n " )
senhal = io.read ( )
for i= 0 , # Contas do
for j= 0 , # Senhas do
if usuariol == Contas[ i] and senhal == Senhas[ j] then
io.write ( "Logado com sucesso!" )
Cadastro( )
end
end
end
end
function Cadastro( )
io.write ( "Ola, seja bem vindo ao sistema de Banco 1.0 By Charles \n " )
io.write ( "Deseja criar uma conta? \n " )
resposta = io.read ( )
if resposta == "sim" or resposta == "Sim" then
io.write ( "Ok, informe seu nome de usuario \n " )
usuario = io.read ( )
io.write ( "Informe sua senha \n " )
senha = io.read ( )
io.write ( "Aguarde um instante!\n " )
if # Contas == 0 and # Senhas == 0 then
table.insert ( Contas, 1 , usuario)
table.insert ( Senhas, 1 , senha)
else
table.insert ( Contas, usuario)
table.insert ( Senhas, senha)
end
Login( )
elseif resposta == "tabela" then
for i, v in ipairs ( Contas) do
print ( v)
end
for i, v in ipairs ( Senhas) do
print ( v)
end
end
end
Cadastro( )
Q29udGEgPSB7YmFsYW5jZSA9IDB9CkNvbnRhcyA9IHt9ClNlbmhhcyA9IHt9CkluaWNpYWwgPSA1MDAwCmZ1bmN0aW9uIENvbnRhOndpdGhkcmF3ICh2KQogICAgQ29udGEuQmFsYW5jZSA9IENvbnRhLkJhbGFuY2UgLSB2CmVuZAoKZnVuY3Rpb24gTG9naW4oKQogICAgaW8ud3JpdGUoIkRpZ2l0ZSBzZXUgVXN1YXJpb1xuIikKICAgIHVzdWFyaW9sID0gaW8ucmVhZCgpCiAgICBpby53cml0ZSgiRGlnaXRlIHN1YSBzZW5oYVxuIikKICAgIHNlbmhhbCA9IGlvLnJlYWQoKQoKICAgIGZvciBpPTAsICNDb250YXMgZG8KICAgICAgICBmb3Igaj0wLCAjU2VuaGFzIGRvCiAgICAgICAgICAgIGlmIHVzdWFyaW9sID09IENvbnRhc1tpXSBhbmQgc2VuaGFsID09IFNlbmhhc1tqXSB0aGVuCiAgICAgICAgICAgICAgICBpby53cml0ZSgiTG9nYWRvIGNvbSBzdWNlc3NvISIpCiAgICAgICAgICAgICAgICBDYWRhc3RybygpCiAgICAgICAgICAgIGVuZAogICAgICAgIGVuZAogICAgZW5kCmVuZAoKZnVuY3Rpb24gQ2FkYXN0cm8oKQogICAgaW8ud3JpdGUoIk9sYSwgc2VqYSBiZW0gdmluZG8gYW8gc2lzdGVtYSBkZSBCYW5jbyAxLjAgQnkgQ2hhcmxlcyBcbiIpCiAgICBpby53cml0ZSgiRGVzZWphIGNyaWFyIHVtYSBjb250YT8gXG4iKQogICAgcmVzcG9zdGEgPSBpby5yZWFkKCkKCiAgICBpZiByZXNwb3N0YSA9PSAic2ltIiBvciByZXNwb3N0YSA9PSAiU2ltIiB0aGVuCiAgICAgICAgaW8ud3JpdGUoIk9rLCBpbmZvcm1lIHNldSBub21lIGRlIHVzdWFyaW8gXG4iKQogICAgICAgIHVzdWFyaW8gPSBpby5yZWFkKCkKICAgICAgICBpby53cml0ZSgiSW5mb3JtZSBzdWEgc2VuaGEgXG4iKQogICAgICAgIHNlbmhhID0gaW8ucmVhZCgpCiAgICAgICAgaW8ud3JpdGUoIkFndWFyZGUgdW0gaW5zdGFudGUhXG4iKQogICAgICAgIGlmICNDb250YXMgPT0gMCBhbmQgI1NlbmhhcyA9PSAwIHRoZW4KICAgICAgICAgICAgdGFibGUuaW5zZXJ0KENvbnRhcywgMSwgdXN1YXJpbykKICAgICAgICAgICAgdGFibGUuaW5zZXJ0KFNlbmhhcywgMSwgc2VuaGEpCiAgICAgICAgZWxzZQogICAgICAgICAgICB0YWJsZS5pbnNlcnQoQ29udGFzLCB1c3VhcmlvKQogICAgICAgICAgICB0YWJsZS5pbnNlcnQoU2VuaGFzLCBzZW5oYSkKICAgICAgICBlbmQKICAgICAgICBMb2dpbigpCgogICAgZWxzZWlmIHJlc3Bvc3RhID09ICJ0YWJlbGEiIHRoZW4KICAgICAgICBmb3IgaSx2IGluIGlwYWlycyhDb250YXMpIGRvCiAgICAgICAgICAgIHByaW50KHYpCiAgICAgICAgZW5kCiAgICAgICAgZm9yIGksdiBpbiBpcGFpcnMoU2VuaGFzKSBkbwogICAgICAgICAgICBwcmludCh2KQogICAgICAgIGVuZAogICAgZW5kCmVuZAoKQ2FkYXN0cm8oKQ==