Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine()); // n = 3
- int num = int.Parse(Console.ReadLine());
- int count = 0;
- bool isFinish = false;
- for (int row = 1; row <= n; row++)
- {
- for (int col = 1; col <= n; col++)
- {
- Console.Write("* ");
- count++;
- if (count == num)
- {
- isFinish = true;
- break;
- }
- }
- Console.WriteLine();
- if (isFinish)
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement