added 9.18 to 9.22

1. separate the ex9_18_19_20.cpp
2. refactor 9.19