0
지정된 캐스트가 유효하지 않습니다. 특정 인덱스가 아니라 배열에 저장된 모든 값에서 최대/최소값을 얻는 방법을 알려주십시오. 가변 배열의지정된 캐스트가 유효하지 않음. 지그재그 배열에서 모든 값 가져 오기
int max = jArray.Cast<int>().Max();
System.Console.Write("\n\n Max marks:" + max);
선언 : int
특정 캐스트가 유효하지 않은 이유를
string TotalStudents;
System.Console.Write("Enter the Total No. Of Students:");
TotalStudents = Console.ReadLine();
int value;
bool result = int.TryParse(TotalStudents, out value);
JaggedArray jag = new JaggedArray(value);
int[][] jArray = new int[jag.noOfStudents][];
for (int i = 0; i < jag.noOfStudents; i++)
{
System.Console.Write("Enter the Total No. Of Subjects of Student:" + i + ":\t");
string TotalSubjects = Console.ReadLine();
int Subjectvalue;
bool Sresult = int.TryParse(TotalSubjects, out Subjectvalue);
jArray[i] = new int[Subjectvalue];
for (int a = 0; a < Subjectvalue; a++)
{
System.Console.Write("\nEnter the marks obtained of subject:" + a + " of student " + i + ":\t");
string TotalMarks = Console.ReadLine();
int Marksvalue;
bool Mresult = int.TryParse(TotalMarks, out Marksvalue);
jArray[i][a] = Marksvalue;
}