using System;
using System.Collections.Generic;
using System.Text;
namespace ej3_3
{
class Program
{
static void Main(string[] args)
{
string c, p;
int i;
p = "pepe";
i = 0;
Console.WriteLine("Escriba la contraseña");
c = (Console.ReadLine());
while ((i < 2) && (c != p))
{
Console.WriteLine("Contraseña Incorrecta");
i += 1;
Console.WriteLine("Tiene otro intento");
c = (Console.ReadLine());
}
if ((i < 3) && (c == p))
Console.WriteLine("Enhorabuena");
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ej3_3
{
class Program
{
static void Main(string[] args)
{
string c, p;
int i;
p = "pepe";
i = 0;
Console.WriteLine("Escriba la contraseña");
c = (Console.ReadLine());
while ((i < 2) && (c != p))
{
Console.WriteLine("Contraseña Incorrecta");
i += 1;
Console.WriteLine("Tiene otro intento");
c = (Console.ReadLine());
}
if ((i < 3) && (c == p))
Console.WriteLine("Enhorabuena");
}
}
}
0 Comments:
Post a Comment
<< Home