史萊姆論壇

返回   史萊姆論壇 > 專業主討論區 > 程式語言討論區
忘記密碼?
論壇說明

歡迎您來到『史萊姆論壇』 ^___^

您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的!

請點擊這裡:『註冊成為我們的一份子!』

Google 提供的廣告


 
 
主題工具 顯示模式
舊 2007-11-19, 04:34 PM   #1
rang0419
註冊會員
榮譽勳章

勳章總數
UID - 285008
在線等級: 級別:0 | 在線時長:4小時 | 升級還需:1小時
註冊日期: 2007-11-07
文章: 24
精華: 0
現金: 35 金幣
資產: 35 金幣
預設 疑問 - 有關陣列的程式問題



--------------------
閱讀本主題的最佳解答
--------------------


看到陣列兩個字我投就要昏了

根本不知道該如何下手..............


Write a menu-driven program that allows the user to fill an array of 50 integers with random numbers in the range of 0 to 1000. The program has the following functions:

(1) Fill the array with random numbers in the range of 0 to 1000. Each time this function is chosen the new random numbers is filled into the array.
(2) Print the array.
(3) Find the maximum and minimum value of the array.
(4) Calculate the mean deviation of the numbers in the array. The mean deviation is defined as Σ|x - x|/n where x = Σx/n.
Ex:
x1 = 124, x2 = 234, x3 = 562, x4 = 12 → x = (124 + 234 + 562 + 12)/4 = 233
mean deviation = (|124 - 233| + |234 - 233| + |562 - 233| + |12 - 233|)/4 = 165
(5) Count the value distributions.

A possible run may look like:
====================== Array Operation Menu ==================
1. Fill the array with random numbers in the range of 0 to 1000.
2. Print the array.
3. Find the maximum and minimum value of the array.
4. Calculate the mean deviation of the numbers in the array.
5. Count the value distributions for each consecutive 100 numbers.
6. Exit.
==========================================================
=> 1
50 random numbers in the range of 0 to 1000 has been filled into the array.
====================== Array Operation Menu ===================
1. Fill the array with random numbers in the range of 0 to 1000.
2. Print the array.
3. Find the maximum and minimum value of the array.
4. Calculate the mean deviation of the numbers in the array.
5. Count the value distributions for each consecutive 100 numbers.
6. Exit.
=========================================================
=> 2
The array is shown as follows:
578 984 630 927 146 917 369 922 598 550
101 51 481 230 901 82 669 759 395 639
42 930 34 576 374 448 359 659 692 705
521 978 303 938 877 18 24 530 487 302
416 186 496 71 667 386 542 877 338 615
====================== Array Operation Menu ===================
1. Fill the array with random numbers in the range of 0 to 1000.
2. Print the array.
3. Find the maximum and minimum value of the array.
4. Calculate the mean deviation of the numbers in the array.
5. Count the value distributions for each consecutive 100 numbers.
6. Exit.
=========================================================
=> 5
The value distributes are shown as follows:
Range Count
0 - 99 7
100 - 199 3
200 - 299 1
300 - 399 8
400 - 499 5
500 - 599 7
600 - 699 7
700 - 799 2
800 - 899 2
900 - 1000 8
====================== Array Operation Menu ==================
1. Fill the array with random numbers in the range of 0 to 1000.
2. Print the array.
3. Find the maximum and minimum value of the array.
4. Calculate the mean deviation of the numbers in the array.
5. Count the value distributions for each consecutive 100 numbers.
6. Exit.
==========================================================
=> 6
Bye!


有高手可以寫一下 借我參考嗎 感恩捏ˊˋ"
rang0419 目前離線  
送花文章: 5, 收花文章: 0 篇, 收花: 0 次
回覆時引用此帖
 



發表規則
不可以發文
不可以回覆主題
不可以上傳附加檔案
不可以編輯您的文章

論壇啟用 BB 語法
論壇啟用 表情符號
論壇啟用 [IMG] 語法
論壇禁用 HTML 語法
Trackbacks are 禁用
Pingbacks are 禁用
Refbacks are 禁用

相似的主題
主題 主題作者 討論區 回覆 最後發表
資訊 - Longhorn 嶄新的驅動程式架構 psac 作業系統操作技術文件 0 2006-07-17 05:13 PM
反病毒引擎設計之既時監控篇 psac 應用軟體使用技術文件 0 2004-08-11 03:48 PM
請問如何在xp完dos game dia700911 軟體應用問題討論區 4 2004-05-22 03:03 PM
請問諾頓2004的問題 andymail 軟體應用問題討論區 8 2004-01-20 07:40 PM
Windows 2000/Xp 錯誤編號詳解(收集整理) psac 作業系統操作技術文件 9 2003-08-03 03:27 PM


所有時間均為台北時間。現在的時間是 10:01 PM


Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.


SEO by vBSEO 3.6.1