G【函式】副程式

G【函式】副程式

G1.計算合計,輸入兩個整數,計算後回傳合計值。

Input: 10 15、Output: 25

G2.兩數交換,輸入兩個整數,交換兩數的內容。難(指標、位址)

Input: a=25,b=36、Output: a=36,b=25

G3.字元交換,輸入兩個字元,交換字元的內容。

Input: s1="A",s2="B"、Output: s1="B",s2="A"

G4.字串交換,輸入兩個字串,交換字串的內容。

Input: s1="world",s2="hello"、Output: s1="hello",s2="world"

G5.四則運算,輸入兩個整數,輸出兩數四則運算。

Input: 10 15、Output: 25, -15, 150, 0.66666666