-
Notifications
You must be signed in to change notification settings - Fork 0
/
Beecrowd1145.cs
34 lines (28 loc) · 868 Bytes
/
Beecrowd1145.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
namespace Course
{
internal class Program
{
static void Main(string[] args)
{
string[] entradas = Console.ReadLine().Split(' ');
int x = int.Parse(entradas[0]);
int y = int.Parse(entradas[1]);
int count = 0; // Usado para controlar a quebra de linha
for (int i = 1; i <= y; i++)
{
Console.Write(i);
count++; // Incrementa o contador
// Se já foram impressos 3 números, quebra a linha e reseta o contador
if (i % x == 0)
{
Console.WriteLine();
}
else
{
Console.Write(" "); // Adiciona um espaço após cada número, exceto o último
}
}
}
}
}