codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <stdlib.h> using namespace std; // with c++11 no need for a helper function, but codepad compiler is old. string to_string(int i) { char buf[10]; sprintf(buf, "%d", i); return buf; } #define F(x) << (!((x)%15)?"fizzbuzz":!((x)%3)?"fizz":!((x)%5)?"buzz":to_string(x)) << endl #define E(a,b,c,d) F(a*20+b*4+c*2+d+1) #define D(a,b,c) E(a,b,c,0)E(a,b,c,1) #define C(a,b) D(a,b,0)D(a,b,1) #define B(a) C(a,0)C(a,1)C(a,2)C(a,3)C(a,4) #define FB B(0)B(1)B(2)B(3)B(4) int main() { cout FB; }
Private
[
?
]
Run code
Submit