Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.c.stdio: printf;
- template Binary(int depth, int a, alias B) {
- static if (depth == 0) {
- enum Binary = 1;
- } else {
- enum Binary = 1 + B!(depth - 1, 0, B) + B!(depth - 1, 1, B);
- }
- }
- void main() {
- enum int N = 550;
- enum int instantiations = Binary!(N, 0, Binary);
- printf("%d\n", instantiations);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement