Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 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 Elso
  9. {
  10. class Program
  11. {
  12.  
  13.  
  14. struct Egyhiányzás
  15. {
  16. public int hónap;
  17. public int nap;
  18. public string név;
  19. public string jelen;
  20. }
  21. static Egyhiányzás[] hiányzás = new Egyhiányzás[500];
  22. static int n = 0;
  23.  
  24. struct Egystat
  25. {
  26. public string név;
  27. public int mulasztás;
  28. }
  29. static Egystat[] stat = new Egystat[50];
  30. static int m = 0;
  31. static void Main(string[] args)
  32. {
  33. Feladat1();
  34. }
  35. static void Feladat1()
  36. {
  37. StreamReader sr = new StreamReader("naplo.txt");
  38. string[] sor1 = new string[3];
  39. string[] sor2 = new string[3];
  40. while (sr.Peek() != -1)
  41. {
  42. sor1 = sr.ReadLine().Split(' ');
  43. while (sr.Peek() != -1 && sr.Peek() != '#')
  44. {
  45. sor2 = sr.ReadLine().Split(' ');
  46. hiányzás[n].hónap = Convert.ToInt32(sor1[1]);
  47. hiányzás[n].nap = Convert.ToInt32(sor1[2]);
  48. hiányzás[n].név = sor2[0] + " " + sor2[1];
  49. hiányzás[n].jelen = sor2[2];
  50. n++;
  51. }
  52. }
  53. }
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement