You are viewing a single comment's thread. Return to all comments →
c#
List<int> listResult = new List<int>(); int nNumberOfStudent = 0; for (int i = 0; i < grades.Count; i++) { if (i == 0) { nNumberOfStudent = grades[i]; continue; } int val = grades[i]; if (val < 38) { listResult.Add(val); } else if ((5 - (val % 5)) <= 2) // 73 -> 3 -> (5-3=2) { listResult.Add(val + (5 - (val % 5))); } else if ((5 - (val % 5)) >= 3) // 67 -> 2 -> (5-2= 3) { listResult.Add(val); } }
code is working on my VS but incorrect value here. strange
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
c#
code is working on my VS but incorrect value here. strange