add new file PAT1007三种实现