看板 TransCSI 關於我們 聯絡資訊
1.The first operational eletronic computer is: (A)ENIAC (B)UNIVACI (C)IBM 650 (D)IBM 360 2.Which of these is not a component of a typical PC? (A)Printer (B)Hard disk (C)Wand Scanner (d)Keyboard (B)和(D)肯定不是~ 3.見http://www2.nuk.edu.tw/lib/exam/94/trans2/94cs(2)-trf.pdf 第27題. 我的解答: #include <stdio.h> int main(int argc, char *argv[]) { int n,h,m,s,exit; printf("Enter a number of seconds: "); scanf("%d",&n); h=n/3600; m=n%3600/60; s=n%3600%60; printf("%d seconds are equal to %d hours , %d minutes, and %d seconds.\n",n,h,m,s); /*printf("Press any key to continue\n");*/ /*scanf("%d\n",&exit);*/ system("pause"); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.226.211.121 ※ 編輯: antirazin 來自: 125.226.211.121 (06/22 14:46)
abien:如果你碰過編譯軟體就不會這樣做了... 06/22 15:20
ahongyeh:試看看 system("pause"); 06/22 17:46
ahongyeh:忽然發現...你是我的對手.... >"< 06/22 17:48
abien:樓上...XD 06/22 17:48
abien:"Press any key to continue..."這行不用刻意打出來 會自動 06/22 17:49
abien:產生 06/22 17:50
※ 編輯: antirazin 來自: 125.228.84.194 (06/23 10:05)
antirazin:我加上去了...可是com過不了...抱歉我寫程式很爛>"< 06/23 10:05
ahongyeh:主程式不要加參數~~(括號裡的東西都拿掉) 06/23 13:21
ahongyeh:另外不要宣告exit~~最後也不用回傳值(return那行拿掉) 06/23 13:22
ahongyeh:最後~~建議你把錯誤訊息PO出來~~不然不知道哪邊有問題~~ 06/23 13:23
bilsted:好懷念阿 這是我考的那年XDD 06/24 00:23
bilsted:不過這程式我complier 沒問題阿XD 06/24 00:29
abien:語法沒錯不代表答案對阿XD 06/24 00:35
abien:system("pause") 使用include<stdlib.h> 而且是print出 06/24 00:43
abien:"請按任意鍵繼續..." 06/24 00:44
antirazin:.....原來是<stdlib.h>和<stdio.h>啊....= = 06/24 09:17
antirazin:送阿~~~~成功了XDDDDDDDDD 感謝各位大大相助 06/24 09:22
※ 編輯: antirazin 來自: 125.228.130.124 (06/24 09:24)