Yahoo Interview Question

all of them are not difficult. basic C/c++ and algorithm problem