Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 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.  
  7. namespace KolisPav
  8. {
  9. public class Fakultetas
  10. {
  11. public string Pav { get; set; }
  12. public int KredSk { get; set; }
  13. public int ModSk { get; set; }
  14. public Studentas studentuKonteineris { get; set; }
  15.  
  16. private Fakultetas[] Fakultetai { get; set; }
  17. public int Kiek { get; set; }
  18.  
  19.  
  20.  
  21. public Fakultetas(string pav, int kredSk, int modSk)
  22. {
  23. Pav = pav;
  24. KredSk = kredSk;
  25. ModSk = modSk;
  26. studentuKonteineris = new Studentas(100);
  27. }
  28. public Fakultetas(int count)
  29. {
  30. Fakultetai = new Fakultetas[count];
  31. }
  32.  
  33. public Fakultetas ImtiFakulteta(int index)
  34. {
  35. return Fakultetai[index];
  36. }
  37.  
  38. public void DetiFakulteta(Fakultetas fakultetas)
  39. {
  40. Fakultetai[Kiek++] = fakultetas;
  41. }
  42.  
  43. public void Sorting()
  44. {
  45. for (int i = 0; i < studentuKonteineris.Kiek - 1; i++)
  46. {
  47. Fakultetas minValue = Fakultetai[i];
  48. int minValueIndex = i;
  49. for (int j = i + 1; j < studentuKonteineris.Kiek; j++)
  50. {
  51. if (Fakultetai[j].studentuKonteineris.ImtiStudenta(j) < minValue.studentuKonteineris.ImtiStudenta(j))
  52. {
  53. minValue = Fakultetai[j];
  54. minValueIndex = j;
  55. }
  56. }
  57. Fakultetai[minValueIndex] = Fakultetai[i];
  58. Fakultetai[i] = minValue;
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement