ISBN13 check digit: Difference between revisions

K
(K)
Line 1,886:
978-1788399083: bad
</pre>
 
=={{header|K}}==
<syntaxhighlight lang=K>digits: {x[&(x>"/")&x<":"]-"0"}
isbn13c: 0=10!+/{x*(#x)#1 3} digits@
 
isbn13c "978-0596528126"
1
isbn13c "978-0596528120"
0
isbn13c " 978-1788399081"
1
isbn13c "978-1788399083"
0</syntaxhighlight>
 
tested with ngn/k
 
=={{header|Kotlin}}==
6,951

edits