경일게임아카데미 실습8 2024 - 12- 18 using System;using System.Collections.Generic;using System.Runtime.InteropServices;namespace ConsoleApp2{ class Buff { public string _buffName; public int _buffTime; public Buff(string buffName, int buffTime) { _buffName = buffName; _buffTime = buffTime; } } class BuffManager { LinkedList _buffs = new LinkedList(); .. 2024. 12. 18. 2024 - 12 -16 using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;using System.Security.Cryptography.X509Certificates;using System.Text;using System.Threading.Tasks;using System.Xml.Serialization;namespace ConsoleApp2{ class UsableItem { string _name; int _price; int _mount; public string Name { get { return _name; } .. 2024. 12. 16. 2024 -12 - 12 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace test{ enum MobType { Nomal , Fire , Water , Grass } class Trainer { int _vetge; string _nameTrain; // 1 public Monster[] _monsters = new Monster[6]; public Trainer(string nameMon) { // 2 _monste.. 2024. 12. 12. 2024 - 12 - 02 (열거형과 구조체) using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace test{ internal class Program { enum Example { a, b, c, d = 5, e } static void Main(string[] args) { Example examp = Example.e; int inputInt = 0; // false , examp = Example 첫번째 값 // .. 2024. 12. 2. 2024 - 11 - 29 심화 과제 1. 복합조건을 가진 함수 제작인자값으로 정수형 하나가 주어지면, 숫자 1에서부터 인자값으로 전달받은 숫자 사이의 모든 자연수 중, 3의 배수이거나 5의 배수인 수들의 합을 구하여 정수형으로 반환하는 함수를 작성하세요2가지 방식으로 접근1번 째 방식. 5의배수 + 3의배수 - 15의 배수2번 째 방식. 3 or 5의 배수 찾기static void Main(string[] args){ int a = int.Parse(Console.ReadLine()); // 5의배수 + 3의배수 - 15의 배수 Console.WriteLine(Result(a)); // 3 or 5의 배수 찾기 Console.WriteLine(Result2(a));}static int.. 2024. 11. 29. 배열 과제 - 2차원 배열 활용 (2024 - 11- 28) 과제14x4 16개의 정수를 담을 수 있는 2차원 배열을 만든 후, 반복문을 이용하여 3의 배수들로 채워 넣는다. 그 후 2행3열 요소와 3행 2열 요소를 바꾼 후 출력하여보자int형 2차원 배열을 선언반복문을 통하여 순서대로 3의 배수들로 채워넣음2행3열 요소와 3행 2열 요소를 바꾼다4x4의 형태로 들어있는 숫자들을 출력※인간의 언어로 2행3열 입니다. 0부터가 아닌 1부터 시작이라고 가정합니다 접근 방식2중 반복문을 활용해 3의 배수를 2차원 배열에 담는데, 그때 1씩 증가하는 K변수 값을 이용해서 0*3 , 1*3 , 2*3 ... 3의 배수를 담아 주었다 static void Main(string[] args){ int k = 0; int[,] array3 = new int[4, 4].. 2024. 11. 28. 이전 1 2 다음