8000 Novos problemas · brenonf/Beecrowd-URI-Solutions@8ea7776 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Novos problemas
Browse files Browse the repository at this point in the history
  • Loading branch information
brenonf committed Jun 28, 2024
1 parent ea8e1ac commit 8ea7776
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions CSharp/1160.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Globalization;

class URI
{
static void Main()
{
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
int x = int.Parse(Console.ReadLine());

for (int i = 0; i < x; i++)
{
string[] y = Console.ReadLine().Split();
int pA = int.Parse(y[0]);
int pB = int.Parse(y[1]);
decimal tA = decimal.Parse(y[2]) / 100;
decimal tB = decimal.Parse(y[3]) / 100;
int anos = 0;

while (pA <= pB)
{
pA += (int)(pA * tA);
pB += (int)(pB * tB);
anos++;

if (anos > 100)
{
break;
}
}

if (anos <= 100)
{
Console.WriteLine($"{anos} anos.");
}
else
{
Console.WriteLine("Mais de 1 seculo.");
}
}
}
}

0 comments on commit 8ea7776

Please sign in to comment.
0