-
Notifications
You must be signed in to change notification settings - Fork 0
/
Beecrowd1113.cs
38 lines (34 loc) · 980 Bytes
/
Beecrowd1113.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
35
36
37
38
using System;
namespace Course
{
internal class Program
{
static void Main(string[] args)
{
while (true) // Loop infinito para ler pares de números até que X seja igual a Y
{
string[] numeros = Console.ReadLine().Split(' ');
int x = int.Parse(numeros[0]);
int y = int.Parse(numeros[1]);
if (x == y) // Verifico se X é igual a Y para encerrar o loop
break;
Console.WriteLine(Ordem(x, y)); // Aqui eu chamo a função para determinar a ordem e imprime o resultado
}
}
static string Ordem(int x, int y)
{
if (x > y)
{
return "Decrescente";
}
else if (y > x)
{
return "Crescente";
}
else
{
return "";
}
}
}
}