#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;
2023-01-17 07:32:23
#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;