fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. int menor = int.MaxValue, maior = 0;
  6. for (int i = 0; i < 5; i++) {
  7. WriteLine("informe o valor: ");
  8. if (!int.TryParse(ReadLine(), out var valor)) WriteLine("valor inválido");
  9. if (valor <= menor) menor = valor;
  10. if (valor >= maior) maior = valor;
  11. }
  12. WriteLine("MAIOR: " + maior);
  13. WriteLine("MENOR: " + menor);
  14. }
  15. }
  16.  
  17. //https://pt.stackoverflow.com/q/393955/101
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(8,38): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty