NedyalkoKikov

RotateMatrix

Jun 3rd, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 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 RotateMatrix
  8. {
  9. class RotateMatrix
  10. {
  11. static void Main()
  12. {
  13. int rows = int.Parse(Console.ReadLine());
  14. int cols = int.Parse(Console.ReadLine());
  15. string[][] matrix = new string[rows][];
  16. for (int i = 0; i < rows; i++)
  17. {
  18. matrix[i] = Console.ReadLine().Split();
  19. }
  20. for (int curentCol = 0; curentCol < cols; curentCol++)
  21. {
  22. for (int currentRwo = rows-1; currentRwo >= 0; currentRwo--)
  23. {
  24. Console.Write(matrix[currentRwo][curentCol] + " ");
  25. }
  26. Console.WriteLine();
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment