Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void ReadCuboid()
- {
- // Read the cuboid size
- string cuboidSize = Console.ReadLine();
- string[] sizes = cuboidSize.Split();
- width = int.Parse(sizes[0]);
- height = int.Parse(sizes[1]);
- depth = int.Parse(sizes[2]);
- // Read the cuboid content
- cuboid = new short[width, height, depth];
- for (int h = 0; h < height; h++)
- {
- string line = Console.ReadLine();
- string[] sequences = line.Split('|');
- for (int d = 0; d < depth; d++)
- {
- string[] numbers = sequences[d].Split(
- new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- for (int w = 0; w < width; w++)
- {
- short cubeValue = short.Parse(numbers[w]);
- cuboid[w, h, d] = cubeValue;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement