Update samplecode.cpp

format codes