using System;
using System.Collections.Generic;
using System.Text;
namespace ej1_1
{
class Program
{
static void Main(string[] args)
{
Random r = new Random();
int aleat2, n;
aleat2 = r.Next(100);
Console.WriteLine(aleat2);
Console.WriteLine("Escriba un número");
n = Int32.Parse(Console.ReadLine());
while (aleat2 < n)
{
Console.WriteLine("el numero es menor");
n = Int32.Parse(Console.ReadLine());
}
while (aleat2 > n)
{
Console.WriteLine("el numero es mayor");
n = Int32.Parse(Console.ReadLine());
}
if(aleat2 == n)
Console.WriteLine("Acertaste el numero");
for (n = 1; n < 100; n++)
{
Console.WriteLine(n);
}
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ej1_1
{
class Program
{
static void Main(string[] args)
{
Random r = new Random();
int aleat2, n;
aleat2 = r.Next(100);
Console.WriteLine(aleat2);
Console.WriteLine("Escriba un número");
n = Int32.Parse(Console.ReadLine());
while (aleat2 < n)
{
Console.WriteLine("el numero es menor");
n = Int32.Parse(Console.ReadLine());
}
while (aleat2 > n)
{
Console.WriteLine("el numero es mayor");
n = Int32.Parse(Console.ReadLine());
}
if(aleat2 == n)
Console.WriteLine("Acertaste el numero");
for (n = 1; n < 100; n++)
{
Console.WriteLine(n);
}
}
}
}
0 Comments:
Post a Comment
<< Home