javaÃæÊÔÌ⣬ÖÊÊýÇóºÍ
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
/**
* ÇóÖÊÊýºÍ£¬
* Èç:
* sum(1)=2=2
* sum(2)=2+3=5
* sum(3)=2+3+5=10
* sum(4)=2+3+5+7=17
* ...
* sum(7)=2+3+5+7+11+13+17=58
*/
System.out.println(Test.sum(7));
}
//²úÉúÖÊÊýnµÄºóÒ»¸öÖÊÊý£¬Èçn=2,return 3
public static int nextNum(int n){
n++;
for(int i=2;i<n;i++){
if(n%i==0){
//²»ÊÇÖÊÊý
n++;
continue;
}
}
return n;
}
//ÇóºÍ·½·¨
public static int sum(int count){
if(count <0) return 0;
int sum = 2;
int zn=2;
for(int i=0;i<count-1;i++){
zn=Test.nextNum(zn);
System.out.println(zn);
sum += zn;
}
return sum;
}
}
Ïà¹ØÎĵµ£º
http://hi.baidu.com/shedewang/blog/item/b4a71b254e43ce35c895599b.html
˵ÊÇÖ§³Ö1ÒÚpv/Ì죬ҲÐíÓеã¿äÕÅ£¬µ«Èç¹ûÄúÄÜÈÏÕæ¿´ÍêÏàÐÅÒ²²»»áÈÃÄúʧÍû¡£
Èç¹û´ó¼ÒÕæÏëÖ§³ÖÎÒ¡¢Ö§³ÖÖйúÈË¿ªÔ´ÏîÄ¿£¬Çë°Ñ¸ÃÎÄÌùµ½×Ô¼ºµÄ²©¿ÍÖлòÕßÊղر¾ÎÄ£¬¼ÇµÃ°üº¬ÎĵµµÄÏÂÔصØÖ·£¡£¡£¡£¡£¡£¡£¡Ð»Ð»¡£
ÎÒ˵µÄϵͳÖ÷ÒªÊǹ¹½¨ÔÚhibernateÖ®ÉÏ ......
ÏÂÎÄÊÇÈÕ±¾ÈË·ÒëµÄÀÏÍâµÄÎÄÕ£¬ÈÕ±¾ÓÐÒ»°ïÈËÔÚ³´Ruby£¬ºÃÏñÊÇÈÕ±¾ÈË·¢Ã÷µÄ£¬Èç¹û¹Ø×¢µÄÈ˶àÁËÒ²ÓпÉÄÜÔÚÒ»¶¨µÄ·¶Î§ÄÚÁ÷ÐÐÆðÀ´¡£
´ËÎĽéÉÜÁËScooter framework¿ò¼Ü£¬ÊÇ»ùÓÚRuby on Rails ¹¹ÖþµÄ£¬ÊÇÒ»¸öSSH¿ª·¢¼¯³ÉµÄÌæ´úÆ·£¬Óõ½ÁËJAVAµÄһЩµ×²ã¼¼Êõ£¬ÓкܶàеĸÅÄ1.0°æ±¾Ô¤¼Æ½ñÄê6£¬7Ô·ݷ¢²¼¡£Ã²Ëƹ¦ÄܺÜÇ¿´ó£¬¸ÐÐ ......
1¡¢´´½¨ÁËÒ»¸ö¶ÔÏóºó£º
£¨1£©Ã»ÓÐÔÚÊʵ±µÄµØ·½Êͷŵô
£¨2£©ÔÚÓ¦¸ÃÊͷŵĵط½Ã»ÓÐ×öÊͷŲÙ×÷
ÀýÈ磺ÏÂÃæÒ»¶Î³ÌÐò£º
m_progressDlg = ProgressDialog.show(this, getString(R.string.market),getString(R.string.is_visiting), true);
new Thread() {
public v ......
ͬÑùµÄ³ÌÐò£¬ÔÚ±ðÈ˵ĵçÄÔÉ϶¼¿ÉÒÔÓã¬ÔÚÎҵĵçÄÔÉÏÈ´ÎÞÂÛÈçºÎ¶¼Í¨²»¹ý£¬ÓôÃÆ°¡¡£
×òÌìÓöµ½Ò»¸öÎÊÌâ¸ãÁËÒ»Ì춼ûÓнâ¾ö£¬
Õâ¸ö³ÌÐòÔÚ±ðÈ˵ĵçÄÔÉÏÓö¼¿ÉÒÔͨ¹ý£¬Ö»ÓÐÔÚÎҵĵçÄÔÉÏÎÞ·¨Í¨¹ý
£¬ÎÒÒ»¿ªÊ¼×°µÄÊÇJDK6.0£¬ºóÀ´Ð¶ÔØÁË×°³ÉÁËJDK5.0£¨ÎªÁ˺ÍËùѧ½Ì³Ì±£³ÖÒ»Ö£¬
ÒÔ¼°ÎÒËÞÉáͨ¹ý²âÊԵĻúÆ÷Ò²ÊÇ×°µÄJDK5.0£©£¬
µ«ÊÇ ......
¡¡1¡¢¶öººÊ½
¡¡¡¡package singleton;
¡¡¡¡/**
¡¡¡¡* ¶öººÊ½µ¥Àý
¡¡¡¡* @author ½¯Ã÷Ô
¡¡¡¡*
¡¡¡¡*/
¡¡¡¡public class HungrySingleton {
¡¡¡¡/**jvm±£Ö¤instanceÖ»±»³õʼ»¯Ò»´Î*/
¡¡¡¡private static HungrySingleton instance = new HungrySingleton();
¡¡¡¡/**×èÖ¹ÍⲿʹÓÃnewʵÀý»¯¶ÔÏó*/
¡¡¡¡private Hun ......