摘要: 全國省市縣無刷新多級聯動菜單
<html><head><title>省市縣關聯菜單</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style>body,select{font-size:9pt;fon...
閱讀全文
???? ?人的成長是絕對的,有的時候只是量變,有的時候是質變。在這個充滿誘惑、充斥著一切的世界里,我們要做的,不是擁有多少物質,而是有自己的一片天空,有和睦的親情、友情......
????? 忙碌的我們,是否感到在都市的落寞,在這里,環境的壓力,工作的壓力,使得我們很少有時間來審視自己,在這里,每個人的空間、時間是被嚴格限制的,就如井底之蛙(frog?in the well)。
???? 我曾閱讀過一句經典的話:
? ?? There are two ways to see growth,one is product,and the other is the process.
??? 我不由想到,我曾經做過錯誤的決定,但我還是執行錯誤的決定,痛苦的是,沒有比這個決定更好的辦法,人,總是為周圍的一切所困,總是掌握不了自己的命脈。
??? 在漫漫的時間里,當自己失去動力以后,一切都變的無所謂,一切都變的不重要,一切都是所謂的裝飾。一個,默默的,做著重復的工作,一遍又一遍........
??? 一站過去了,而另外一站又奔來,沿途的風景,使忙碌的我們忽略了周圍........
????一個人上網的時候很喜歡進西安信息資源網,在那里讀著一些勵志的文章,每當我疲憊的時候,想起了一起生活在這個世界的大多數人們,他們有自己的生存原則.......
???? 每個人都有兩個天使陪伴著他,一個是善良的,一個是邪惡的,
???? 在這個世界的現實里,我學會了更多的是理性,而不是感性,世界的悲劇,太多是由感性戰勝理性引起的,一時的沖動引起的,而在喪失理性之后,他們不得不面對理性........
????
?
第一題
/*
?求兩個字符串的最大公共子串
?String s1 = "abcdefghigj";
?String s2 = "xyzabcdeigj";
?則輸出abcde
*/
第二題
/*
輸出楊輝三角形
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
*/
第三題
/*
String[] a = {"a","b","c","d","e","f","g","h","i","j","",""};
String[] b = {"f","a","c","f","e","k","l","y","p","o"};
如果b里面的數據在a里面沒有,則把沒有的數據放到""里面,超過的話,則報"已經滿了,無法插入"~~
*/
解析:
第一題:
public class first
{
? public String search(String s1,String s2)
? {
? String max = "";
? for(int i=0; i<s1.length(); i++)
? {
??? for(int j=i; j<s1.length(); j++)
??? {
????? String sub = s1.substring(i,j);
????? if((s2.indexOf(sub)!=-1)&&sub.length()>max.length())
????? {
??????? max = sub;
????? }
??? }
? }?
? return max;
? }
?
? public static void main(String[] args)
? {
??? String s1 = "abcdefghigj";
??? String s2 = "xyzabcdefigj";
??? String output = new first().search(s1,s2);
??? System.out.println(output);
? }
}
第二題:
public class second
{
? public static int[] general(int[] data)
? {
??? int[] fanhui = new int[data.length+1];?
??? fanhui[0] = data[0];
??? for(int i=1,j=1; j<data.length; i++,j++)
??? {
????? fanhui[i] = data[j-1] + data[j];
??? }?????????
??? fanhui[fanhui.length-1] = data[data.length-1];
??? for(int k=0; k<fanhui.length; k++)
??? {
????? System.out.print(fanhui[k] + "\t");
??? }
??? System.out.print("\n");
??? return fanhui;
? }
? public static void main(String[] args)
? {
??? int times = 5;
??? int[] chushizhi = {1};
??? System.out.println(chushizhi[0]);
??? for(int i=0; i<times; i++)
??? {
??? chushizhi = second.general(chushizhi);???
??? }
? }
}
第三題:
import java.util.ArrayList ;
public class Third
{
public static void main(String[] args)
{
??? String[] a = {"a","b","c","d","e","f","g","h","i","j","k","",""};
??? String[] b ={"f","a","c","f","e","k","l"};
??? Third third = new Third();
??? third.compareAndReplace(a,b);
??? StringBuffer output = new StringBuffer();
??? for(int i=0; i<a.length; i++)
??? output.append(a[i]);?
??? System.out.println("a已變成" + output.toString());
? }
?public void compareAndReplace(String[] a,String[] b)
?{
?? for(int i=0; i<b.length; i++)
?? {
????? outer:
???? for(int j=0; j<a.length; j++)
???? {
?????? if(b[i].equals(a[j]))
?????? break outer;
?????? if(j==a.length-1)
?????? {
?????? if(findFirstSpace(a)!=-1)
?????? {
???????? a[findFirstSpace(a)] = b[i];
?????? }
?????? else
?????? {
???????? System.out.println("已經滿了,無法插入" + b[i]);
?????? }??????
???? }
?? }
?}
?}
?
?public int findFirstSpace(String[] arg)
?{
?? for(int m=0; m<arg.length; m++)
?? {
???? if(arg[m].equals(""))
???? return m;????
?? }
?? return -1;
?}
}