Hieu
Hieu
WriteLine("Cac so duong");
for (int j = 0; j < a.Length; j++)
if (a[j]> 0)
{
Console.WriteLine("a[{0}] = {1}", j, a[j]);
}
Console.WriteLine("Cac so le");
for (int j = 0; j < a.Length; j++)
if (a[j] % 2 != 0)
{
Console.WriteLine("a[{0}] = {1}", j, a[j]);
}
Console.WriteLine("Cac so am");
for (int j = 0; j < a.Length; j++)
if (a[j] < 0)
{
Console.WriteLine("a[{0}] = {1}", j, a[j]);
}
Console.WriteLine("Cac so chan");
for (int j = 0; j < a.Length; j++)
if (a[j] %2== 0)
{
Console.WriteLine("a[{0}] = {1}", j, a[j]);
}
2. for (int j = 0; j < a.Length; j++)
if (a[j]> 0)
{
Console.WriteLine("[{0}] ", j);
}
for (int j = 0; j < a.Length; j++)
if (a[j]< 0)
{
Console.WriteLine("[{0}] ", j);
}