摘要: 每日一题:查找数组中最大最小值问题描述:给定数组a1, a2, a3, ... an,要求编写函数f输出改数组的最大值和最小值。假设数组中的值两两不相同。思路:朴素的算法可以通过遍历的算法,通过2n次的比较得到数组中的最大值和最小值。实现代码如下:publicclassPair{//构造函数publicPair(intmax,intmin){this._max=max;this._min=min;}//属性privateint_max;publicintMax{get{returnthis._max;}set{this._max=value;}}privateint_min;publicint 阅读全文
posted @ 2010-12-07 20:35 qiang.xu 阅读(5567) 评论(0) 推荐(0) 编辑
摘要: java mail 收发邮件1.发件2.收件1.发件packagebase.util;/*SomeSMTPserversrequireausernameandpasswordauthenticationbeforeyoucanusetheirServerforSendingmail.ThisismostcommonwithcoupleofISP'swhoprovideSMTPAddresstoSendMail.ThisProgramgivesanyexampleonhowtodoSMTPAuthentication(UserandPasswordverification)Thisisa 阅读全文
posted @ 2010-12-07 13:53 qiang.xu 阅读(3759) 评论(1) 推荐(0) 编辑