JavaÀàÇó½âÒ»Ôª¶þ´Î·½³ÌµÄ¸ù
Ù¡Ç¿ http://blog.csdn.net/microtong
OakCMSÄÚÈݹÜÀíϵͳ http://www.oakcms.cn http://www.oakcms.net
Ò»Ôª¶þ´Î·½³Ìax2+bx+c=0£¬ÊäÈëa,b,cÈý¸öϵÊý£¬Çó½â·½³Ì£¬½á¹ûÓÐÈýÖÖÇé¿ö£ºÁ½¸öʵÊý¸ù¡¢Ò»¸öʵÊý¸ù¡¢Á½¸ö¸´Êý¸ù¡£
/**
* Equation.java
*/
package cn.edu.uibe.oop;
/**
* ¼ÆËãÒ»Ôª¶þ´Î·½³ÌµÄ¸ù
* @author TongQiang
*
*/
public class Equation {
double a,b,c; //·½³ÌµÄϵÊý
double x1,x2; //Á½¸ö¸ù
double r; //ʵ²¿
double v; //Ð鲿
int type; //0±íʾһ¸ö¸ù£¬1±íʾÁ½¸öʵ¸ù£¬2±íʾÁ½¸ö¸´ÊýµÄ¸ù
public Equation(double a,double b,double c){
this.a = a;
this.b = b;
this.c = c;
}
private double delta(){
return b*b-4*a*c;
}
public void calculate(){
double d = delta();
if(Math.abs(d) < 1E-5){
type = 0;
x1 = -b/(2*a);
x2 = x1;
}else if(d > 0){
type = 1;
x1 = (-b+Math.sqrt(d))/(2*a);
x2 = (-b-Math.sqrt(d))/(2*a);
}else{
type = 2;
r = -b/(2*a);
v = Math.sqrt(-d)/(2*a);
}
}
public void showResult(){
switch(type){
case 0:
System.out.println("·½³ÌÖ»ÓÐÒ»¸öʵ¸ù£¬x1=x2="+x1);
break;
case 1:
System.out.println("·½³ÌÓÐÁ½¸öʵ¸ù£¬·Ö±ðÊÇ£ºx1="+x1+"\tx2="+x2);
break;
case 2:
System.out.println("·½³ÌÓÐÁ½¸ö¸´Êý¸ù£¬·Ö±ðÊÇ£º"+r+"+"+v+"i,\t"+r+"-"+v+"i");
break;
}
}
public static void main(String[] args) {
Equation eq1 = new Equation(1,2,2);
eq1.calculate();
eq1.showResult();
&nbs
Ïà¹ØÎĵµ£º
Java SwingÖеÄJTreeÄ£ÐÍ
2009-01-04 10:40
±¾ÎĽéÉÜJava SwingÖеÄJTreeÄ£ÐÍ£¬½éÉÜÈçºÎ´´½¨¡¢Ð޸ġ¢±éÀú£¬ÉèÖÃÊ÷¡£²Î¿¼Core Java2Ïà¹ØÕ½ڼ°ÆäÔ´´úÂë¡£
SwingÊ÷ʹÓÃÈËÃÇËùÊìϤµÄÎļþ¼ÐºÍÊ÷ҶͼÀ´ÏÔʾ·Ö²ãµÄÊý¾Ý¡£Ê÷Óɽڵã×é³É£¬½Úµã¿ÉÒÔÊÇÎļþ¼Ð£¬Ò²¿ÉÒÔÊÇÊ÷Ò¶¡£Îļþ¼Ð¿ÉÒÔÓÐ×ӽڵ㣬³ý¸ù½ÚµãÖ®ÍâµÄËùÓнڵ㶼ֻÓÐÒ»¸ö¸ ......
xmlÎļþ£º
Xml´úÂë
<?xml version="1.0" encoding="GB2312"?>
<RESULT>
<VALUE>¡¡¡¡
<NO>A1234</NO>¡¡¡¡
<ADDR>ºÓÄÏÊ¡Ö£ÖÝÊÐ</ADDR>
</VALUE>&nbs ......
ÒÔO(n)µÄʱ¼äʵÏÖ¶ÔÕýÕûÊýµÄÅÅÐò¡£Ë¼Â·ÊÇ£º´Ó×îĩλ¿ªÊ¼£¬¶ÔÊý×éÖÐÿһ¸öÊýµÄµÚkλ½øÐмÆÊýÅÅÐò£¬Ö±µ½Åŵ½×î¸ßλΪֹ¡£
ȱµã£ºÖ»ÄܶÔÕýÕûÊý½øÐÐÅÅÐò£¬¶øÇÒÐèÒªÖªµÀ×î´óÕûÊýµÄ×î¸ßλ£¬Ê¹Ó÷¶Î§Ì«Ð¡¡£µ«ÕⲻʧΪһ¸öºÜÓÐȤµÄÅÅÐò£¬ÒòΪËüµß¸²Á˱ȽÏÅÅÐòµÄ´«Í³Ë¼Â·¡£
public static int[] radixSort(int[] inputs,int d){
......
1 Ïà¹Ø֪ʶ½éÉÜ
1.1 SMB
MicrosoftÍøÂçÅäÖÃÖÐÖ÷Òª²ÉÓÃSMBÐÎʽʵÏÖÎļþ¹²ÏíºÍ´òÓ¡·þÎñ£¬SMB£¨·þÎñÆ÷ÏûÏ¢¿é£©ÊÇÒ»ÖÖ¿Í»§¶Ë/·þÎñÆ÷Îļþ¹²ÏíÐÒé¡£IBMÓÚ20ÊÀ¼Í80Äê´úÄ©ÆÚ¿ª·¢ÁË·þÎñÆ÷ÐÅÏ¢¿é£¨SMB£©£¬ÓÃÓڹ淶¹²ÏíÍøÂç×ÊÔ´£¨ÈçĿ¼¡¢Îļþ¡¢´òÓ¡»úÒÔ¼°´®Ðж˿ڣ©µÄ½á¹¹¡£ÕâÊÇÒ»ÖÖÇëÇó/ÏìÓ¦ÐÒé¡£ÓëFT ......
¶ÔÓÚjavaµÄÍøÂç±à³ÌÊéÖÐÌÖÂÛµÄÈ«²¿¹éÄÉÆðÀ´ÓÐSocketµÄʹÓã¬DatagramSocketµÄʹÓã¬javaÓëCGIµÄÅäºÏʹÓã¬javaÁ¬½ÓÊý¾Ý¿âÒÔ¼°javaÖе÷ÓÃÔ¶³Ì·½·¨¡£
Ê×ÏÈÊÇSocketµÄʹÓ㬶ÔÓÚ·þÎñ¶ËÀ´Ëµ£¬Ó¦¸ÃÉùÃ÷µÄÊÇServerSocket¶ÔÏó£¬È»ºóʹÓÃSocket
accept()·½·¨½øÐÐ ......