#include <iostream>
using namespace std; int main() {
int n;
int a[];
int i=,count=;
while(cin>>n){
a[i] = n;
count++;
i++;
if (getchar() == '\n') break;
}
for(int j=;j<count;j++){
cout<<a[j]<<" ";
}
}
重点是
if (getchar() == '\n') break;
#include <iostream>
using namespace std; int main() {
int n;
int a[];
int i=,count=;
while(cin>>n){
a[i] = n;
count++;
i++;
if (getchar() == '\n') break;
}
for(int j=;j<count;j++){
cout<<a[j]<<" ";
}
}
重点是
if (getchar() == '\n') break;