藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年6月6日 10:18


Anyone can help me...Thanks

A program that asks the user to enter a list of integers.  程式是會決定輸入Number中的最大值和最大值一共輸入了多少次. For example, 如輸入了下列幾組數字
5 2 15 3 7 15 8 9 5 2 15 3 7
輸出最大值為15和一共輸入了 3次.


如何計出我共輸入了15這number三次..?
thanks..

Anyone can help me...Thanks

max=-1; num=0;
foreach element in array
{
if element >;max {max=element; num=1); }
else if element==max num++;
}



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com