-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzzyset.cpp
More file actions
55 lines (54 loc) · 953 Bytes
/
fuzzyset.cpp
File metadata and controls
55 lines (54 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<iostream>
using namespace std;
double max(double A, double B)
{
if(A>B)
return A;
else
return B;
}
double min(double A, double B)
{
if(A<B)
return A;
else
return B;
}
double complement(double A)
{
return 1-A;
}
int main()
{
double A[7], B[7];
int i;
cout<<"Enter the members of set A: ";
for(int i=0;i<7;i++)
{
cin>>A[i];
}
cout<<"Enter the members of set B: ";
for(int i=0;i<7;i++)
{
cin>>B[i];
}
cout<<"Union of A and B: "<<endl;
cout<<"A"<<"\t"<<"B"<<"max(A,B)"<<endl;
for(i=0;i<7;i++)
{
cout<<A[i]<<"\t"<<B[i]<<"\t"<<max(A[i],B[i])<<endl;
}
cout<<"Intersection of A and B: "<<endl;
cout<<"A"<<"\t"<<"B"<<"min(A,B)"<<endl;
for(i=0;i<7;i++)
{
cout<<A[i]<<"\t"<<B[i]<<"\t"<<min(A[i],B[i])<<endl;
}
cout<<"Complement of set A: "<<endl;
cout<<"A"<<"\t"<<"1-A"<<endl;
for(i=0;i<7;i++)
{
cout<<A[i]<<"\t"<<complement(A[i])<<endl;
}
return 0;
}