fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int[] conjunto = { 3, 45, 24, 7, 8, 10 };
  8. int mayor = conjunto[0];
  9.  
  10. for (int i = 1; i < conjunto.Length; i++)
  11. {
  12. if (conjunto[i] > mayor)
  13. {
  14. mayor = conjunto[i];
  15. }
  16. }
  17.  
  18. Console.WriteLine("El mayor es " + mayor);
  19. }
  20. }
  21.  
  22.  
Success #stdin #stdout 0.07s 30656KB
stdin
Standard input is empty
stdout
El mayor es 45