目前分類:C++的世界 (22)

瀏覽方式: 標題列表 簡短摘要
  1. Write a program that uses a function template called min to determine the smaller of two

arguments. Test the program using integer, character and floating-point number arguments.

題目要求一個比小的機制,輸入數值或字元,然後輸出較小的那個數字。特殊要求是要用 function template來做。一樣是呼叫引用的練習。話說不知道中文字有沒有辦法比小啊?顆顆顆...

 

 

Output should look as follows:

archerdevil 發表在 痞客邦 留言(0) 人氣()

  1. Write a complete program that prompts the user for the radius of a sphere, and calculates

and prints the volume of that sphere. Use an inline function sphereVolume that returns the result of the following expression: ( 4.0 / 3.0 ) * 3.14159 * pow( radius, 3 ).

 

Output should look as follows:

 

Enter the length of the radius of your sphere: 10

archerdevil 發表在 痞客邦 留言(0) 人氣()

«12