#include
#include
using namespace std;
int main() {
int n=10, i1=0, i2=0;
int a[n], b[n], c[n];
srand(time(NULL));
cout<<"a:"<<endl;<br> for (int i=0; i {
a[i]=rand() % 50-25;
cout<<a[i]<<" ";<br> }
cout<<endl;<br> for (int i=0; i if (a[i]>0) { b[i1]=a[i]; i1++ ;}
else if (a[i]<0) { c[i2]=a[i]; i2++ ;}<br> for (int i=0; i cout<<endl;<br> for (int i=0; i cout<<endl;<br>
system("pause");
return(0);
}
Пример:
a:
4 20 8 -21 13 -1 23 17 0 9
4 20 8 13 23 17 9
-21 -1