#include <iostream>
using namespace std;
void sort(int *a,int b,int c)
{
int temp=a[b];
for(int i=b;i<c;i++)
{
int max=i;
for(int j=i+1;j<c;j++)
{
if(a[max]<a[j])max=j;
}
if(max!=i)
{
temp=a[max];
a[max]=a[i];
a[i]=temp;
}
}
}
int sum(int *a,int b)
{
int sumb=0;
for(int i=0;i<b;i++)sumb+=a[i];
return sumb;
}
main()
{
int a[10];
cout<<"plese enter 10 data:";
for(int i=0;i<10;i++)cin>>a[i];
sort(a,0,10);
int b[10],c[10],b_i=0,c_i=0;
memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
for(i=0;i<10;i++)
{
if(sum(b,b_i)>sum(c,c_i))
{
c[c_i]=a[i];
c_i++;
}
else
{
b[b_i]=a[i];
b_i++;
}
}
cout<<"b is:";
for(i=0;i<b_i;i++)cout<<b[i]<<",";
cout<<"\n c is";
for(i=0;i<c_i;i++)cout<<c[i]<<",";
cout<<"\n ";
return 0;
}