看板 EE_DSnP 關於我們 聯絡資訊
======================= 我是用Dev C++. 然後像是作業第2題我complie過後執行, 他會跑出一個dos 介面, 如題 目叫我輸入兩個integer, 但是我輸入之後, 按下Enter之後, 確沒有跑出”the sum is” 這個答案, 而且那個dos視窗也自己關掉了. 然後我自己也嘗試寫一段從課本裡的一段程 式, 結果還是一樣, 雖然有顯示出要user輸入的那個畫面, 但是輸入完畢按enter之後, 整個介面就消失了.請問是我用的軟體有問題嗎? >>> you can add a line system(“pause”); just before “return 0;” Or there may be some options for DevC++, but I don’t know. Or open a dos window first, and then execute the program by typing the program name. ============================ 作業的第三題, 請問”shortest”的意思是什麼? 是需要cout出來一些東西? 還是只要寫 出程式碼就好了呢? >>> The problem 3 is to write a “shortest program”, meaning the source code itself is shortest. Nothing to do with cout. ============================ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.128.24
nomadone:還是不太懂第三題的意思 是要寫出可以跑的程式 又要程式 09/29 21:28
nomadone:碼是最短的?! 09/29 21:29
nomadone:還有第五題的"platform independent"是說JAVA可以在不同 09/29 21:30
nomadone:的平台下執行嗎? 09/29 21:32
DoraBoy:我也搞不清楚第三題的意思~如果要shortest 那可以寫一個沒 09/29 22:12
DoraBoy:有內容(只有架構) 的程式嗎 09/29 22:13
ric2k1:是的 可以跑且compile不會有error & warning 的程式 09/29 23:45
ric2k1:[Hint] 空格也算是一個字元喔 09/29 23:51
ric2k1:Yes. "platform independent" = 可以在不同平台下執行 09/29 23:52
oops750513:可以了...加了system(pause)就行了...謝謝 09/30 21:57