PCDVD數位科技討論區
PCDVD數位科技討論區   註冊 常見問題 標記討論區為已讀

回到   PCDVD數位科技討論區 > 其他群組 > 疑難雜症區
帳戶
密碼
 

回應
 
主題工具
xeonic
Major Member
 

加入日期: Oct 2003
文章: 119
[java] 如何寫會秀出原始碼的程式?

我現在用java寫一個會印出程式本身原始碼的程式
用BufferedReader和FileReader後很簡單的寫了出來
不過後來發現老師說不能用InputStream寫
不知有沒有高手可以指導一下要如何寫?

原題目:
Write a computer program that takes no input (i.e., no command line arguments nor files nor data streams) and outputs its source code. Provide both the source and an output of it running.
     
      
舊 2006-02-23, 05:38 AM #1
回應時引用此文章
xeonic離線中  
Impression
Regular Member
 

加入日期: Mar 2002
您的住址: 臺北
文章: 57
這個題目就是要寫出self-reproducing的程式

http://www.nyx.net/~gthompso/quine.htm
這邊有很多範例...
 
舊 2006-02-23, 09:48 AM #2
回應時引用此文章
Impression離線中  


回應


POPIN
主題工具

發表文章規則
不可以發起新主題
不可以回應主題
不可以上傳附加檔案
不可以編輯您的文章

vB 代碼打開
[IMG]代碼打開
HTML代碼關閉



所有的時間均為GMT +8。 現在的時間是12:08 PM.


vBulletin Version 3.0.1
powered_by_vbulletin 2025。