[C++] 期中考詳細參考答案
參考程式碼如下: int caluScore(string &answer, int rightScore, int unansweredScore, int wrongScore) { string reply; getline(cin,reply); int score = 0; int length = reply.size(); for (int i=0;i<length;i++) { if (reply[i] == '.') break; if (reply[i] == ' ') score += unansweredScore; else if (reply[i] == answer[i]) score += rightScore; // means wrong else score += wrongScore; } if (score>100) score = 100; if (score<0) score = 0; return score; } ps 不太懂為什麼題目要傳參 &answer...