Advertisement
Guest User

Untitled

a guest
Feb 11th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace ConsoleApplication6
  9. {
  10. class Program
  11. {
  12. static List<string> varos = new List<string>();
  13. static List<int> ev = new List<int>();
  14. static List<int> hossz = new List<int>();
  15. static List<string> bajnok = new List<string>();
  16.  
  17. static void Main(string[] args)
  18. {
  19. StreamReader olvas = new StreamReader("verseny.txt", Encoding.Default);
  20. while(!olvas.EndOfStream)
  21. {
  22. string sor = olvas.ReadLine();
  23. string[] darab = sor.Split(';');
  24. varos.Add(darab[0]);
  25. ev.Add(Convert.ToInt32(darab[1]));
  26. hossz.Add(Convert.ToInt32(darab[2]));
  27. bajnok.Add(darab[3]);
  28.  
  29. }
  30. olvas.Close();
  31. Feladat_2();
  32. Console.WriteLine();
  33. Feladat_3();
  34. Console.WriteLine();
  35. Feladat_4();
  36.  
  37. Console.ReadKey();
  38. }
  39.  
  40. static void Feladat_2()
  41. {
  42. Console.WriteLine("2.Feladat:");
  43. int min = ev[0];
  44. for(int i = 0; i < ev.Count; i++)
  45. {
  46. if(ev[i] < min)
  47. {
  48. min = ev[i];
  49. }
  50. }
  51. Console.WriteLine("Az első pályát " + min + "-ban adták át.");
  52. }
  53.  
  54. static void Feladat_3()
  55. {
  56. Console.WriteLine("3.Feladat:");
  57. int max = hossz[0];
  58. int maxhely = 0;
  59. for(int i = 0; i < hossz.Count; i++)
  60. {
  61. if(hossz[i] > max)
  62. {
  63.  
  64. }
  65. }
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement