In the ISBN-10 (International Standard Book Numbering) system that was used until the end of 2006, each book is assigned a unique 10-digit code. The first nine digits uniquely identify the book itself, whereas the last digit merely serves as a check digit to detect invalid ISBN-10 codes.
If
Check whether a given series of ten digits corresponds to a valid ISBN-10 code.
Ten digits
The word OK if the given digits correspond to a valid ISBN-10 code, otherwise the word WRONG.
Input:
9 9 7 1 5 0 2 1 0 0
Output:
OK
Input:
9 9 7 1 5 0 2 1 0 8
Output:
WRONG
In the following instruction video, Pythia explains how to tackle this assignment. Watch this video as a stepping stone to solve other exercises about conditional statements1.