永恆交界處

程式設計 作業2

首先,我們偉大的助教跟教授出了一堆亂七八糟的作業
尤其是助教完全不懂我們的能力在哪,出了一個我完全不會用的作業Orz。

不過他身上味道很香(X

這是教授第二次出題,題目是:

Please write a class with two methods to transform the input into another form similar to its output. The first method is to transform a numerical figure (input) into an inverse numerical figure (output). For example, the input is 345, the output is 543; the input is 43210, the output is 012345. The second method is to extend a non-numerical word into a symmetric word. For example, the input is hello, the output is helloolleh; the input is you, the output is youuoy. That is, the output seems to have a mirror in the middle of the word that you can fold the word into a half and the corresponding alphabets are the same.
The program first asks the user to input a string, and then checks whether the input is a numerical or non-numerical input. If a numerical, the program uses the first method to process it; otherwise, the second method.

對我來講還算簡單,所以就有下面的東西。
至於助教出的怪物,那又是另外一回事了。

我認真認為助教出太難,因為要用到method又要class有的沒的,根本會混亂。

Facebook 粉絲專頁,賞個讚吧。<(_ _)>