public void Add(Opertion op) { int a, b, t; Random rd = new Random(); b = rd.Next(1, 101); a = s; t = a + b; Console.WriteLine("+" + b + "=" + t); }
public void Div(Opertion op) { float a, b, t; Random rd = new Random(); b = rd.Next(1, 101); a = s; while (a % b != 0) { b = rd.Next(1, 101); } t = (int)(a / b); Console.WriteLine("/" + b + "=" + t); }
public void Sub(Opertion op) { int a, b, t; Random rd = new Random(); b = rd.Next(1, 101); a = s; while (a != 0 && b > a) { b = rd.Next(1, 51); } if (a == 0) { t = a + b; Console.WriteLine("+" + b + "=" + t); } else { t = a - b; Console.WriteLine("-" + b + "=" + t); } }