ellapt

6.12.SquareMatrixOrderN

Dec 5th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System;
  2. class SquareMatrixOrderN
  3. {
  4. static void Main()
  5. {
  6. string strNum;
  7. uint n;
  8. uint i;
  9. uint j;
  10. do
  11. {
  12. Console.Write("Please, enter an unsigned integer number 0 < N < 20: ");
  13. }
  14. while ((!uint.TryParse(strNum = Console.ReadLine(), out n)) || n == 0 || n >= 20);
  15.  
  16. for (i = 1; i <= n; i++)
  17. {
  18. for (j = i; j < i + n; j++)
  19. {
  20. Console.Write("{0, 5}", j);
  21. }
  22. Console.WriteLine();
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment