This is the pascal code I wrote and write during working in 48 middle school.