normal oscillator c++ code