fork download
  1. using System;
  2. using static System.Console;
  3.  
  4. namespace ConsoleApplication1 {
  5. public class Program {
  6. static int[] Fornecimento(int[] numero) {
  7. // Clear();
  8. WriteLine("*****************************************************************");
  9. WriteLine($"*{new String(' ', 63)}*");
  10. WriteLine($"*{new String(' ', 16)}FORNECIMENTO DE NUMEROS{new String(' ', 24)}*");
  11. WriteLine($"*{new String(' ', 63)}*");
  12. WriteLine("*****************************************************************");
  13. WriteLine($"\n{new String(' ', 8)}O que deseja fazer: \n\n{new String(' ', 8)}=>1-Fornecer os numeros \n{new String(' ', 8)}=>2-Gerar numeros automaticamente \n\n{new String(' ', 8)}Escolha uma opcao: ");
  14. int opcao = Convert.ToInt32(ReadLine()); //espero que esta variável vá ser usada em outro lugares
  15. if (opcao == 1) {
  16. //espero que vá fazer alguma aqui
  17. }
  18. return numero;
  19. }
  20.  
  21. public static void Main(string[] args) {
  22. int[] numero = new int[500000];
  23. int retorno = 1, tipo = 0; //tipo precisa ser declarada aqui mesmo? no momen to não
  24. while (retorno == 1) { //este while não faz o menor sentido
  25. // Clear(); //por alguma razão aqui dá problema executar, mas pode descomentar isso
  26. WriteLine("*****************************************************************");
  27. WriteLine($"*{new String(' ', 63)}*");
  28. WriteLine($"*{new String(' ', 16)}ALGORITMO DE ORDENACAO{new String(' ', 25)}*");
  29. WriteLine($"*{new String(' ', 63)}*");
  30. WriteLine("*****************************************************************");
  31. while (tipo >0 && tipo < 4) {
  32. //isso é muito gambo, o ideal seria fazer cada linha em um comando próprio, arumei um pouco mas desisti de fazer tudo
  33. Write($"\n\n{new String(' ', 8)}Que tipo de algoritmo deseja utilizar: \n\n{new String(' ', 8)}1-Inserction sort \n{new String(' ', 8)}2-Selection sort \n{new String(' ', 8)}3-Bubble sort \n\n{new String(' ', 8)}Escolha uma opção=> ");
  34. tipo = Convert.ToInt32(ReadLine()); //esta convers]ao é insegura, prefira um int.TryParse()
  35. }
  36. Fornecimento(numero);
  37. retorno++;
  38. }
  39. }
  40. }
  41. }
  42.  
  43. //https://pt.stackoverflow.com/q/131317/101
Success #stdin #stdout 0.02s 15996KB
stdin
Standard input is empty
stdout
*****************************************************************
*                                                               *
*                ALGORITMO DE ORDENACAO                         *
*                                                               *
*****************************************************************
*****************************************************************
*                                                               *
*                FORNECIMENTO DE NUMEROS                        *
*                                                               *
*****************************************************************

        O que deseja fazer: 

        =>1-Fornecer os numeros 
        =>2-Gerar numeros automaticamente 

        Escolha uma opcao: