Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Collections.Generic;
  4. namespace ConsoleApp1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string[] lines = System.IO.File.ReadAllLines(@"C:\Users\local\source\repos\ConsoleApp1\ConsoleApp1\probki.txt");
  11. string[] Linestypes = System.IO.File.ReadAllLines(@"C:\Users\local\source\repos\ConsoleApp1\ConsoleApp1\typy.txt");
  12. List<String[]> Matrix = Wczytaj(lines);
  13. List<String[]> MatrixofTypes = Wczytaj(Linestypes);
  14.  
  15.  
  16. Console.WriteLine("Tablica elementow");
  17. foreach (var item in Matrix)
  18. {
  19. Console.WriteLine(string.Join(' ',item));
  20. }
  21. Console.WriteLine("Tablica typow");
  22. foreach (var item in MatrixofTypes)
  23. {
  24. Console.WriteLine(string.Join(' ', item));
  25. }
  26. Console.ReadKey();
  27. }
  28.  
  29. public static List<String []> Wczytaj( string [] path)
  30. {
  31. List<String[]> Tmp = new List<String[]>();
  32. for (int i = 0; i < path.Length; i++)
  33. {
  34. string[] element;
  35. element = path[i].Split(' ');
  36. Tmp.Add(element);
  37. }
  38. return Tmp;
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement