Guest User

Untitled

a guest
May 30th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10.  
  11. /*---------------------------------------------------
  12. Métodos do programa
  13. ---------------------------------------------------*/
  14.  
  15. //Método de fornecimento de numeros
  16. int[] Fornecimento(int[] numero)
  17. {
  18. int opcao;
  19. //apresentação do tipo de opcao
  20. Console.Clear();
  21. Console.Write("*****************************************************************");
  22. Console.Write("n*tttttttt*");
  23. Console.Write("n*ttFORNECIMENTO DE NUMEROStttt*");
  24. Console.Write("n*tttttttt*");
  25. Console.Write("n*****************************************************************");
  26. Console.Write("nntO que deseja fazer: nnt=>1-Fornecer os numeros nt=>2-Gerar numeros automaticamente nntEscolha uma opcao: ");
  27. opcao = Convert.ToInt32(Console.ReadLine());
  28.  
  29. if (opcao == 1)
  30. {
  31.  
  32. }
  33.  
  34. return (numero);
  35. }
  36.  
  37.  
  38. /*---------------------------------------------------
  39. Método principal do programa
  40. ---------------------------------------------------*/
  41. static void Main(string[] args)
  42. {
  43. //declaração de variáveis
  44. int[] numero = new int[500000];
  45. int retorno = 1, tipo = 0;
  46.  
  47. while (retorno == 1)
  48. {
  49. //comando limpa a tela
  50. Console.Clear();
  51. //apresentação do programa
  52. Console.Write("*****************************************************************");
  53. Console.Write("n*tttttttt*");
  54. Console.Write("n*tttALGORITMO DE ORDENACAOttt*");
  55. Console.Write("n*tttttttt*");
  56. Console.Write("n*****************************************************************");
  57.  
  58. //menu de escolha do tipo de algoritmo de ordenação(loop repete até que um tipo válido seja inserido)
  59. while ((tipo != 1) && (tipo != 2) && (tipo != 3))
  60. {
  61. Console.Write("nntQue tipo de algoritmo deseja utilizar: nnt1-Inserction sort nt2-Selection sort nt3-Bubble sort nntEscolha uma opção=> ");
  62. tipo = Convert.ToInt32(Console.ReadLine());
  63. }
  64.  
  65. numero = Fornecimento(numero);
  66.  
  67. }
  68. retorno++;
  69. //Environment.Exit(exitCode);
  70. Console.ReadKey();
  71. }
  72. }
  73. }
Add Comment
Please, Sign In to add comment