Friday, July 10, 2015

[1] Exam Score - Tính điểm bài thi - easy ( Olympic BKHN - colleges 2011)

Đề thi Olympic tin học khối cao đẳng - Trường Đại Học Bách Khoa Hà Nội (2011)

Trong một bài thi có 20 câu hỏi trắc nghiệm, số điểm cho mỗi câu trả lời đúng là khác nhau, càng trả lời đúng liên tiếp số điểm càng cao. Câu trả lời đúng đầu tiên sẽ được 1 điểm, các câu trả lời đúng liên tiếp tiếp theo bằng điểm của câu trả lời đúng trước + 1. Nếu trả lời sai, câu trả lời đúng tiếp theo được tính lại từ 1 điểm. (như hình vẽ mô tả):




Ví dụ: Câu đầu tiên đúng được 1 điểm, câu thứ 2 liên tiếp 2 điểm, câu thứ 3 liên tiếp 3 điểm, câu thứ 4 sai 0 điểm ... cứ như vậy cho đến hết.

[Đầu vào] dãy 20 số bao gồm các số 0 và 1 (0 là câu trả lời sai, 1 là câu trả lời đúng) được cách nhau bằng dấu "space".
Đầu ra ] Tổng số điểm đạt được của thí sinh.
[Các yêu cầu khác] Không nêu ra.


Exam Olympic college - Hanoi University of  Science and Technology (2011)

In a test with 20 multiple choice questions, the score for each correct answer is different, more correct answers in a row the higher the score. The first correct answer will receive 1 point for correct answers in a row followed by the location of the correct answer before + 1. If the answer is wrong, correct answer next be recalculated from 1 point. (as shown in the picture):

For example: The first true 1 point, 2nd consecutive sentences 2 points, the 3rd consecutive 3 points, 4th question wrong 0 points ... so on until the end.

[Input] range of 20 numbers including 0 and 1 (0 for an incorrect answer, the correct answer 1) are separated by "space".
[Output] Total points achieved by the candidate.
[Other Requirements] Not yet.

Các bạn vui lòng để lại hướng dẫn giải bằng code C/C++ dưới nhận xét của từng bài. Cảm ơn.
You please leave instructions with the code C / C ++ under review of each post. Thank you. )

No comments:

Post a Comment

Popular Posts