c++输入一行数组

361 阅读1分钟
int num[100];    //int型数组用于存储输入变量
int i=0;
while (cin>>num[i]){
    cout<<num[i]<<" ";
    i++;
}