Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.stdio, std.range, std.algorithm;
- static immutable int[] KEYS = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4];
- void main() {
- stdin.byLine.dropOne.each!((i, line) => writefln("Case #%d: %d", i+1, line.map!(c => (c == ' ' ? 1 : KEYS[c - 'a'])).sum));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement