# 税码检查，有什么问题，有什么区别？

please help me with the following code. The code itself is from UriOnlineJudge(https://www.urionlinejudge.com.br/judge/en/problems/view/1051), but after many hours spent trying to figure out the problem i had to resolve to this site. First one is this:

``````

double sal = 0.0, t8 = 0.0, t18 = 0.0, t28 = 0.0;
if(sal <= 2000.0)
{
Console.WriteLine("Isento");
}else if( 2000.0 < sal && sal <= 3000.0)
{
t8 = ((sal - 2000.00) * 0.08);
Console.WriteLine("R\$ " + String.Format("{0:F2}", t8));
} else if (3000.0 < sal && sal <= 4500.0)
{
t18 = ((sal - 3000.00) * 0.18 + 1000.00 * 0.08);
Console.WriteLine("R\$ " + String.Format("{0:F2}", t18));
}
else
{
t28 = ((sal - 4500.00) * 0.28 + 1500.00 * 0.18 + 1000.00 * 0.08);
Console.WriteLine("R\$ " + String.Format("{0:F2}", t28));
}

``````

``````
double sal = 0.0, t8 = 0.0, t18 = 0.0, t28 = 0.0;
if(sal <= 2000.0)
{
Console.WriteLine("Isento");
}else if( 2000.0 < sal && sal <= 3000.0)
{
sal = sal - 2000.0;
t8 = sal * 8.0 / 100.0;
t8 = sal + t8;
Console.WriteLine("R\$ " + String.Format("{0:0.00}", t8));
} else if (3000.0 < sal && sal <= 4500.0)
{
sal = sal - 3000.0;
t8 = 1000.0 * 8.0 / 100.0;
t18 = sal;
t18 = t18 * 18.0 / 100.0;
t18 = t18 + t8;
Console.WriteLine("R\$ " + String.Format("{0:0.00}", t18));
}
else
{
sal = sal - 4500.0;
t8 = 1000.0 * 8.0 / 100.0;
t18 = 1500.0 * 18.0 / 100.0;
t28 = sal;
t28 = t28 * 28.0 / 100.0;
t28 = t28 + t18 + t8;
Console.WriteLine("R\$ " + String.Format("{0:0.00}", t28));
}