瀏覽單個文章
Tirpitz
Master Member
 
Tirpitz的大頭照
 

加入日期: Apr 2001
您的住址: Coruscant
文章: 1,637
引用:
Originally posted by Rhoads
你所謂的高手是寫作業的高手嗎?...
別把太瞧不起高手囉
你為程式有那麼簡單嗎.程式最基板就是資料結構 離散數學 演算法
很明顯的,樓主顯然沒學過資料結構.



不要吵起來啦。calm...
我的確還沒學過資料結構唷,這不是我的本行。
我想wei836500是對我這種平庸的人說的啦,不是對厲害大師說的。
勤能補拙嘛∼如果一直打擊我的信心,那會很難過低。

另外,我已經參考你的大作。
修改一下我學過和沒學過的東西。
(陣列還沒學啦,其實TOKEN也還沒學到,我偷用結果問題更大)

ㄧ開始會寫到上百行是被書上的範例的想法引導到別的地方去囉。
第五個修改版。
import javax.swing.*;
import java.util.*;

class EX5{
public static void main(String[] args){
String name = JOptionPane.showInputDialog(null,"Enter an string")+" ";
StringBuffer inputStringBuffer = new StringBuffer();
System.out.println(name);

for(int i = 0; i < name.length(); i++) {
char letter = name.charAt(i);
if (Character.isLetter(letter)||Character.isDigit(letter)) {
inputStringBuffer.append(letter);

}else{
System.out.print(inputStringBuffer.reverse().toString()+letter);
inputStringBuffer.setLength(0);
}
}
System.out.println();
System.exit(0);
}
}


這樣應該可以了。感謝各位協助提供我不同的想法。謝謝大家。
可以的話,請大家推薦一下java書籍。資料結構(最好是JAVA的範例)也行啦。明年就會學到了。
我要休息囉。想了一個禮拜精�**^的很緊,現在放鬆一下。
 
__________________
Un Jedi ne doit connaitre ni la colere, ni la haine, ni l'amour.
Someday I will be the most powerful Jedi ever~!!

Jedi Code
there is no emotion;there is the peace
there is no ignorance;there is the knowledge
there is no passion;there is the serenity
there is no death;there is the Force
舊 2004-05-15, 05:24 PM #22
回應時引用此文章
Tirpitz離線中