Talk:Middle three digits: Difference between revisions

No edit summary
Line 10:
 
==C++ entry and generalization to other numbers of digits==
The check rejecting the cases where `(len % 2 == 0)` is only correct if the length is also odd. It's perfectly reasonable to request the middle 2 digits of a 4-digit number, etc. So the correct check is thatto reject the case where the length of the string hasdoes not have the same parity as the number of digits being requested (len % 2 != n % 2). [[User:Markjreed|Markjreed]] 05:13, 5 February 2013 (UTC)
1,479

edits