读书人

输入任意字符 暂停 一个简单的c++ 小

发布时间: 2012-01-18 00:23:26 作者: rapoo

输入任意字符 暂停 一个简单的c++ 小程序
#include <iostream.h>
#include "stdio.h"

#define N 5

void main()
{
int A[N],i;
for(i=0;i<N; i++)
{
cin>>A[i];
}
cout<<endl;
for(i=0;i<N; i++)
{
cout<<A[i];
}
//cout <<"\npress any key to close";
//system("pause");
//getch ();
cout<<endl;
}
我想输入5个数据后 回车 暂停 输出press any key to close 再按任意键结束
这么写 我
还有就是暂停后 按任意键继续 我百度了下 说 system("pause"); 或者getch ();
但不知道怎么用
本人刚刚学VC 大家多多指教


[解决办法]

C/C++ code
#include <iostream>using namespace std;#define N 5 int main(){    int A[N],i;     for(i=0;i <N; i++)     {         cin>>A[i];     }           cout <<endl;     for(i=0;i <N; i++)     {         cout <<A[i];     }     cout <<endl;     system("pause");     return 0;} 

读书人网 >VC

热点推荐