App Class using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study10 { class App { //생성자 public App() { //"히어로"가 "보물상자"를 열어 "아이템"을 얻는다. Hero hero = new Hero("링크"); //히어로 클래스 생성 Chest chest = new Chest(); hero.open = (link) => { Console.WriteLine("히어로({0})가 상자를 오픈 했습니다.", hero.Name); }; Item item = chest.IsOpen(); //출력 //히..
내가 짠 코드 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study07 { class App { //생성자 public App() { //최대값 구하기 int[] arrs = { 20, 10, 35, 30, 7 }; for (int i =0; i test) { test = arrs[i]; Console.WriteLine(test); } } //출력 //35 } } 최소값 구하기 for문 밖으로 변수 출력시키기 using System; using System.Collections.Generic; using System.Linq..
using System; namespace Study03 { class Program { static void Main(string[] args) { //App 클래스를 생성하고 생성자 메서드를 작성하고 //new 키워드를 사용해서 App클래스의 인스턴스를 생성한다 new App(); //App형식의 변수 app을 정의하세요 App app; //app변수에 App클래스의 인스턴스를 할당하세요 app = new App(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study03 { class App { //생성자 ..