added task3.cpp
added task3.cpp