Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _04.Cube_3D
- {
- class Program
- {
- static void TopPartCube3D(int n)
- {
- int colon = n;
- int space=n-2;
- int verticalLine=1;
- Console.WriteLine("{0}",new string(':',colon));
- Console.WriteLine(":{0}::", new string(' ', space));
- for (int row = 1; row <= n - 2; row++)
- {
- if (row == n-2)
- {
- Console.WriteLine("{0}{1}:", new string(':', colon),
- new string('|', verticalLine));
- }
- else
- {
- Console.WriteLine(":{0}:{1}:", new string(' ', space), new string('|', verticalLine));
- verticalLine++;
- }
- }
- int minus = n-2;
- verticalLine--; ;
- colon = 1;
- space = 1;
- for (int row = 0; row < n-2; row++)
- {
- Console.WriteLine("{0}:{1}:{2}:", new string(' ', space), new string('-', minus),
- new string('|', verticalLine));
- verticalLine--;
- space++;
- }
- colon =n;
- Console.WriteLine("{0}{1}", new string(' ', space),new string(':', colon));
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- TopPartCube3D(n);
- }
- }
- }
Add Comment
Please, Sign In to add comment