Orar semigroup #2
Comments (2)
-
#include
using namespace std;
int main()
{int i,j,a,k=0,b,x,c,d;
cin>>a>>b>>c>>d>>x;
if(x>=a && x<=b)
k=1;
if(x>=c && x<=d)
k=1;
if(k==1)
cout<<"Igen";
else cout<<"Nem";
cout<<endl;
for(i=a;i<=b;i++)
{
x=i;
for(j=c;j<=d;j++)
{
if(j==i)
cout<<j<<" ";
}
}
} -
Intersectia intervalelor
#include
using namespace std;
int main()
{int i,j,a,k=0,b,c,d,min,max;
cin>>a>>b>>c>>d;
cout<a)min=c;
else min=a;
if(b<d)max=b;
else max=d;
if(max<min)cout<<"Nu au elemente comune";
else cout<<min<<";"<<max;
}