#include<math.h>h(x){return x&2?pow(x,x&1?x:2):(x&1)*2*x;}main(){int i; for(i=0;i<20;++i) printf("%u %u\n", i, h(i));}
Standard input is empty
0 0 1 2 2 4 3 27 4 0 5 10 6 36 7 823543 8 0 9 18 10 100 11 2147483648 12 0 13 26 14 196 15 2147483648 16 0 17 34 18 324 19 2147483648
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!