Софтуерно Инженерство
Loading...
vondoom avatar vondoom 0 Точки

[C# Basics] Sunglasses, Drawing Figures with Loops 0 / 100

Очилата ми се получават идеално, но получавам 0 точки. Вярно, направих ги по друг начин, но пак трябва да имам някакви точки.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sunglasses
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            for (var i = 0; i <= 1; i++)

            {
                if (n >= 3 && n <= 100)
                    Console.Write(new string('*', 2 * n));
                for (var h = 0; h <= n; h++) Console.Write(" ");

            }
            Console.WriteLine();

            for (var i = 0; i <= 1; i++)                                                    
            {
                for (var row = 1; row <= n - 2; row++)
                {
                    Console.Write("*");
                    Console.Write(new string('/', 2 * n - 2));
                    
                    Console.Write("*");
                    if (row == (n-1)/2)
                    {
                        Console.Write(new string('|', n+1));
                    }
                    for (var h = 0; h <= n; h++)
                        if (row == (n-1) /2 )
                        {
                            Console.Write("");
                        }
                    else
                            Console.Write(" ");
                    Console.Write("*");
                    Console.Write(new string('/', 2 * n - 2));
                    Console.Write("*");
                    Console.WriteLine();                  
                }
                for ( i = 0; i <= 1; i++)
                   
                {
                    if (n >= 3 && n <= 100)
                        Console.Write(new string('*', 2 * n));
                    for (var h = 0; h <= n; h++) Console.Write(" ");
                }
            }
        }
    }
}

0
C# Fundamentals 23/02/2017 16:30:24
fbinnzhivko avatar fbinnzhivko 1574 Точки

Колега сбъркал си това не е въпрос за [C# Fundamentals] а за basic.
 

Console.Write(" "); Тези празни места чупят твоята логика.



http://pastebin.com/vGFWCv4t - Решение

1
23/02/2017 16:36:15
vondoom avatar vondoom 0 Точки

Поправих го, но пак не разбирам защо Judge не ми дава точки.

0