我不懂這題目問的意思~C++程式!!!

不好意思哦

我不是在請人幫看我做作業

而是我不懂題目的意思

可以幫我解釋一下嗎^^~

麻煩了!!!

順便提示一下是最好的^^"

題目如下:

This programming assignment consists of 10 problems. Download this cpp file and add your code. The problems are:

1. Read in integers until -999 is typed in. Print out the number of integers typed in. The last number, -999, does not count.

2. Same condition as the previous problem, but print out the sum of these integers instead. Take proper action when no integers are read in.

3. Same condition as before, print out the average of these integers.

4. Same condition as before, print out the number of integers that are positive.

5. Same condition as before, print out the sum of those integers that are positive.

6. Same condition as before, print out the average of those integers that are positive. Take proper action when no integers are read in.

7. Same condition as before, print out the value of the largest integer typed in.

8. Same condition as before, print out the value of the smallest integer typed in.

9. Same condition as before, print out the number of integers that is equal to the largest value in Problem 7.

10. 期中考有這樣一題:

寫一for loop印出1, 3, 5, …, 199。

正確答案為

for (i=1; i<=199; i+=2)

cout << i << endl;

這種簡單規則的題目和答案可以用出題程式自動產生,只要輸入幾個參數後出題程式就會輸出題目以及答案。請寫一程式,讀入四個數(如上例的1, 3, 5, 199),自動產生題目及答案。

!!!此題很難,尤其是當輸入值不合理時,如1, 3, 5, -100。可假設輸入參數合理,但你必須正確處理上行或下行兩種可能。

Update:

英翻中也行

不過要翻的通順!!!!

最好有提示會更好^^

4 Answers

Rating
  • Anonymous
    1 decade ago
    Favorite Answer

    This programming assignment consists of 10 problems. Download this cpp file and add your code. The problems are:

    1. Read in integers until -999 is typed in. Print out the number of integers typed in. The last number, -999, does not count.

    你要寫個程式讓使用者不斷的輸入數字

    如果輸入-999就停止,然後印出使用者剛剛共輸入幾個數字,

    但是最後那個數字(也就是-999)不能算進去

    -------------------------------------

    2. Same condition as the previous problem, but print out the sum of these integers instead. Take proper action when no integers are read in.

    印出上題那些數字的總和(除了最後那個-999)

    如果使用者沒有輸入任何數(也就是一開始就輸入-999),請讓程式作適當的處理

    -------------------------------------

    3. Same condition as before, print out the average of these integers.

    同上題,印出那些數的平均

    -------------------------------------

    4. Same condition as before, print out the number of integers that are positive.

    同上題,告訴使用者共輸入幾個"正整數"(類似第一題)

    -------------------------------------

    5. Same condition as before, print out the sum of those integers that are positive.

    同上題,把這些正整數加總在輸出(類似第二題)

    -------------------------------------

    6. Same condition as before, print out the average of those integers that are positive. Take proper action when no integers are read in.

    同上題,印出這些正整數的平均值(類似第三題)

    -------------------------------------

    7. Same condition as before, print out the value of the largest integer typed in.

    還是同上題,這題要你印出最大的數字

    -------------------------------------

    8. Same condition as before, print out the value of the smallest integer typed in.

    又是同上題,請印出最小的數

    -------------------------------------

    9. Same condition as before, print out the number of integers that is equal to the largest value in Problem 7.

    仍然是同上題...印出有幾個數等於最大的數(例如最大的是7,你要找出使用者輸入的數裡面有幾個數字是7)

    -------------------------------------

    2006-11-01 16:20:21 補充:

    第10題麻煩說清楚一點

  • 1 decade ago

    ~@@" 這位是???? 學長嗎...... 你好!!!

  • 學弟,這種問題可以到3107來問助教

  • Lv 7
    1 decade ago

    請問你是要英翻中嗎?

Still have questions? Get your answers by asking now.