add for loop in c++