Water collected between towers: Difference between revisions

Content deleted Content added
m →‎{{header|Visual Basic .NET}}: Forgot to halve the result, since I doubled the blocks.
m →‎{{header|C sharp|C#}}: changed to more efficient character counting a the end.
Line 330: Line 330:
if (args.Length > 0) Console.Write("{0}", blk);
if (args.Length > 0) Console.Write("{0}", blk);
Console.WriteLine("Block {0} retains {1,2} water units.\n", i + 1,
Console.WriteLine("Block {0} retains {1,2} water units.\n", i + 1,
(blk.Replace(lf, "").Replace("██", "").Replace(" ", "")).Length / 2);
(blk.Length - blk.Replace("≈≈", "").Length) / 2);
}
}
}
}