标签:style names int iostream bre while count space ios
#include <iostream> using namespace std; int main() { int n; int a[100]; int i=0,count=0; while(cin>>n){ a[i] = n; count++; i++; if (getchar() == ‘\n‘) break; } for(int j=0;j<count;j++){ cout<<a[j]<<" "; } }
重点是
if (getchar() == ‘\n‘) break;
标签:style names int iostream bre while count space ios
原文地址:https://www.cnblogs.com/whalelife/p/10498967.html