while(cin >> rplace_x >> rplace_y )
for(int i=0;i<limit;i++) { cin>>temp; if(temp<0){ break; } a[i]=temp; }
用cin来控制while循环
原文:https://www.cnblogs.com/Augustusben/p/14269232.html