#include <stdio.h>
int add (int a, int b) { return a + b; }
int calculate (int (*p)(int, int), int a, int b) {
return p(a, b);
}
int main(void) {
int (*p) (int, int);
p = add;
printf("Result: %d", calculate
(p
, 2, 3)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgYWRkIChpbnQgYSwgaW50IGIpIHsgcmV0dXJuIGEgKyBiOyB9CmludCBjYWxjdWxhdGUgKGludCAoKnApKGludCwgaW50KSwgaW50IGEsIGludCBiKSB7CglyZXR1cm4gcChhLCBiKTsKfQoKaW50IG1haW4odm9pZCkgewoJaW50ICgqcCkgKGludCwgaW50KTsKCQoJcCA9IGFkZDsKCQoJcHJpbnRmKCJSZXN1bHQ6ICVkIiwgY2FsY3VsYXRlKHAsIDIsIDMpKTsKCXJldHVybiAwOwp9Cg==