문제 3번 by 김윤정

// 학원 선생님이 내주신 과제


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!!");

            for (int i = 0; i <= 3; i++)
            {
                for (int j = 3; j > i; j--)
                {
                    Console.Write(" ");
                }

                for (float k = 0; k <= i; k += 0.5f)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }

            for (int i = 1; i <=3 ; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write(" ");
                }

                for (float k = 3; k >=i ; k-= 0.5f)
                {
                    Console.Write("*");
                }

                Console.WriteLine();
            }


        }
    }
}



//3번 다시

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!!");


            // 2줄만 돌리기

            for (int i = 0; i <= 2; i++)
            {
                for (int j = 2; j > i; j--)
                {
                    Console.Write(" ");
                }

                for (float k = 0; k <= i; k += 0.5f)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }

            // 3줄 돌리기
            for (int i = 1; i <= 2; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write(" ");
                }

                for (float k = 2; k >= i; k -= 0.5f)
                {
                    Console.Write("*");
                }

                Console.WriteLine();
            }


        }
    }
}




MyADD

<script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>