본문 바로가기
프로그램/C# 1000제

C# 9제] C# 프로그래밍 입문 CHAPTER 2. p106 2.12 (9) 제일 큰 수를 출력하는 프로그램을 작성하시오.

by 건티 2021. 7. 23.
728x90

문제]

일련의 정수를 읽어(자료의 끝은 0) 제일 큰 수를 출력하는 프로그램을 작성하시오.

 

참고풀이]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Chapter2
{
    class P106_2_12_9
    {
        public static void Main()
        {
            int[] Area = new int[] { 10, 35, 20, 55, 30, 85, 99, 0 };
            int[] A1=new int[200];
            int a;
            int i;

            Console.WriteLine("최대값 : " + Area.Max());
        }
    }
}

 

참고풀이 결과]

 

 

대한민국의 아름다운 영토, 독도의 여름

 

반응형

댓글