小编Chr*_*men的帖子

在C#中比较两个数组后如何修复输出?

所以我有这个作业分配,要求我在比较两个数组后将输出分配给标签。我的问题是比较两个数组后,分配的输出是错误的。如果在两个数组的特定索引处相等,我应该输出“ Y”,如果它们不相等,则应该输出“ N”,但是每次我运行代码时,无论什么,它都会向所有标签输出“ Y” 。比较后如何解决输出的内容?

     private void evaluateStudentAnswers()
        {
            /* Use a "for" loop to cycle through the answerKey[] and studentAnswers[] arrays, and compare the answers
             * in the two arrays at each index.  If they match, then increment the global variable "correctAnswers"
             * and assign the value 'Y' to the corresponding index in the correctOrIncorrect[] array.  if they
             * don't match, then increment the global variable "incorrectAnswers" and assign the value 'N' to the
             * corresponding indes in the …
Run Code Online (Sandbox Code Playgroud)

c# asp.net arrays for-loop output

1
推荐指数
1
解决办法
54
查看次数

标签 统计

arrays ×1

asp.net ×1

c# ×1

for-loop ×1

output ×1