برنامه ی اشتراک و اجتماع دو مجموعه مرتب شده
include
void main()
{
int n, m, x[50], y[50];
register c;
cout<<"Enter the number of first list's elements:";
cin>>n;
cout<<"Enter the first sorted list:"<
cout<<"Now enter the number of second list's elements:";
cin>>m;
cout<<"Enter the second sorted list:"<
//------------------------------------------------------------
cout<<"Union: ";
char ch;
i=0;
for(i=0;i
cout<
{
ch=0;
for(i=0;i
{
ch=1;
break;
}
if(ch!=1)
cout<
cout<
cout<<"Subscription: ";
c=0;
for(i=0;i
for(;y[c]<=x[i]&&c
{
cout<
}
//-------------------------------------------------------------
}
//end
نظرات شما عزیزان: