게시글
질문&답변
2023.07.18
IEnumerable 강의 따라하는 중 질문합니다.
(사진)강의 21분 35초 보고 더 따라했는데도 똑같습니다.ㅠㅠ using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Exam11_1{ class Exam11_1 { public void Run() { TestBasic(); //TestStudent(); } private void TestStudent() { Student[] students = new Student[] {new Student("홍길동", 89, 1), new Student("황진이", 87, 2)}; IEnumerator enumerator = students.GetEnumerator(); while (enumerator.MoveNext()) Console.WriteLine(enumerator.Current); } private void TestBasic() { int[] intArray = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; //for (int i = 0; i //IEnumerator enumerator = intArray.GetEnumerator(); //while (enumerator.MoveNext()) //{ // Console.WriteLine(enumerator.Current); //} //foreach() //foreach (int i in intarray) Console.WriteLine(i); string str = "abcdefg"; foreach (char c in str) Console.WriteLine(c); } } class Student { public string Name { get; set; } public int Score { get; set; } public int Id { get; set; } public Student(string name, int score, int id) { Name = name; Score = Score; Id = id; } public override string ToString() { return $"{Name}[{Id}][{Score}]"; } }}
- 0
- 3
- 403
고민있어요
2023.05.12 17:58
2:23 체크 안하고 설치해도 상관 없나요?
- 0
- 1
- 232