ÓÃjavaÇó½âÒ»µÀȤζÌå:123456789²åÈë+£¬
×î½üÔÚCSDN£¬¿´µ½ÁËÒ»µÀȤζÌ⣺123456789Õâ¾Å¸ö°´Ë³ÐòÅÅÁеÄÊý£¬ÒªÇóÔÚËüÃÇÖ®¼ä²åÈëÈô¸É¸ö+£¬-£¬*£¬/ £¬Ê¹Æä½á¹ûÕýºÃµÈÓÚ
100È磺1*2*3*4+5+6+7*8+9=100¡£
¿´ÁËÌâÄ¿ºó£¬Ë¼¿¼Èç¹ûÓÃjavaÈçºÎʵÏÖ¡£ÒÔÏÂÊÇÎҵĽâÌâ˼·£º
˼Ïë±È½Ï¼òµ¥£¬ÏȽ«²åÈë+£¬-£¬*£¬/ºóµÄËùÓÐ×Ö·û´®¶¼Çî¾Ù³öÀ´£¬È»ºó¼ÆËãÄÄЩ×Ö·û´®µÈÓÚ100¡£
ÕâÀïÒª½â¾öÁ½¸öÎÊÌ⣬һ¸öÊÇÔõÑù½«ËùÓеÄ×Ö·û´®¶¼Çî¾Ù³öÀ´£¬ÁíÒ»¸öÊÇÔõÑù½«×Ö·û´®µÄÖµ¼ÆËã³öÀ´¡£
µÚÒ»¸öÎÊÌâ˼·£º²åÈë+£¬-£¬*£¬/£¬ÆäʵӦ¸ÃÊDzåÈë"+", "-", "*", "/", ""¡£²åÈë""±íʾÏàÁÚÊý×Ö×é³ÉÒ»¸öÊý¡£ÓõݹéʵÏÖ¼ÓÈëÿ¸ö·ûºÅ£¬Ö±µ½¼ÓÈë×îºóÒ»¸öÊý×Ö¡£
µÚ¶þ¸öÎÊÌâ˼·£ºÊ¹ÓÃÕ»ÏȽ«Ò»°ãµÄÖÐ׺±í´ïʽÈç1*2*3*4+5+6+7*8+9ת³Éºó׺±í´ïʽ1 2 *3 *4 *5 +6 +7 8 *+9 +£¬
È»ºóÔÙÓÃÕ»½«ºó׺±í´ïʽµÄÖµÇó³ö£¬¾ßÌå˼·¿ÉÒÔÈ¥¿´ÏÂÕ»ÔÚ¼ÆËã±í´ïʽֵµÄÓ¦Óá£
ÒÔÏÂÊǾßÌåµÄ´úÂ룺
import java.util.Stack;
import java.util.Vector;
public class Hundred {
/**
* ½«ÖÐ׺±í´ïʽתΪºó׺±í´ïʽ
* @param expstr
* @return
*/
public static String toPostfix(String expstr) {
Stack<String> stack = new Stack<String>();
String postfix = "";
int i = 0;
while (i < expstr.length()) {
char ch = expstr.charAt(i);
switch (ch) {
case '+':
case '-': while (!stack.isEmpty()) {
postfix += stack.pop();
}
stack.push(ch +"");
i++;
break;
case '*':
case '/': while (!stack.isEmpty() && (stack.peek().equals("*")
|| stack.peek().equals("/"))) {
postfix += stack.pop();
}
 
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Ê®½øÖÆת³ÉÊ®Áù½øÖÆ£º
Integer.toHexString(int i)
Ê®½øÖÆת³É°Ë½øÖÆ
Integer.toOctalString(int i)
Ê®½øÖÆת³É¶þ½øÖÆ
Integer.toBinaryString(int i)
Ê®Áù½øÖÆת³ÉÊ®½øÖÆ
Integer.valueOf("FFFF",16).toString()
°Ë½øÖÆת³ÉÊ®½øÖÆ
Integer.valueOf("876",8).toString()
¶þ½øÖÆתʮ½øÖÆ
Intege ......
¶ÓÁÐÊÇÉè¼Æ³ÌÐòÖг£ÓõÄÒ»ÖÖÊý¾Ý½á¹¹¡£ËüÀàËÆÈÕ³£Éú»îÖеÄÅŶÓÏÖÏ󣬲ÉÓÃÒ»ÖÖ±»³ÆΪ
“ÏȽøÏȳö”(FIFO)µÄ´æ´¢½á¹¹¡£Êý¾ÝÔªËØÖ»ÄÜ´Ó¶Óβ½øÈ룬´Ó¶ÓÊ×È¡³ö¡£ÔÚ¶ÓÁÐÖУ¬
Êý¾ÝÔªËØ¿ÉÒÔÈÎÒâÔö¼õ£¬µ«Êý¾ÝÔªËصĴÎÐò²»»á¸Ä±ä¡£Ã¿µ±ÓÐÊý¾ÝÔªËØ´Ó¶ÓÁÐÖб»È¡³ö£¬
ºóÃæµÄÊý¾ÝÔªËØÒÀ´ÎÏòÇ°Òƶ¯Ò»Î»¡£ËùÒÔ£¬ÈκÎʱºò ......
±¾ÎÄÊÇÓÉJRÖ÷³Öд×÷µÄ¡¶J2SE½ø½×¡·Ò»ÊéµÄ²¿·ÖÕ½ÚÕûÀí¶ø³É£¬¡¶J2SE½ø½×¡·ÕýÔÚд×÷¡¢ÍêÉƽ׶Ρ£ÄúÔĶÁºó£¬ÓÐÈκν¨Òé¡¢ÅúÆÀ£¬ÇëºÍÎÒÁªÏµ£¬»òÔÚhttp://www.javaresearch.org/forum/thread.jsp?column=376&thread=7576' target='_blank' class='l2'>Õâ¶ùÁôÑÔ¡£¡¶J2SE½ø½×¡·Ð´×÷ÏîÄ¿×é¸ÐлÄúÔĶÁ±¾ÎÄ¡£
ÔÚµ±½ñÕ ......
package mylib.webxml;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
*
* @author jmp esp
* @version 1.0
*
&nbs ......