[問題] c++ 2008 express的問題

看板C_and_CPP (C/C++)作者 (巫醫 阿貝斯特)時間16年前 (2009/05/07 01:01), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
我想請問一下 為什麼 當我編譯完的時候 編譯完後的window 它會自己關掉 我想看編譯完後 cout出來的值 但是因為會自動關掉 所以只能看到一下下 請問要設定什麼東西 以下是我的程式碼 #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int main() { int a[5]; for(int i=0;i<5;i++) { printf("第%d個數字:",i+1); scanf("%d",&a[i]); } for(int i=0;i<=4;i++) { cout<<"\nfinial a="<<a[i]; } return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.221.148

05/07 01:15, , 1F
system("pause");
05/07 01:15, 1F

05/07 07:58, , 2F
執行的時候按ctrl+f5就好
05/07 07:58, 2F

05/07 23:48, , 3F
在RETURN 0; 前面加上 system("pause");
05/07 23:48, 3F
文章代碼(AID): #1A0S9Glr (C_and_CPP)
文章代碼(AID): #1A0S9Glr (C_and_CPP)