2024-3-13

Change encoding
This commit is contained in:
2024-03-13 11:32:13 +08:00
parent b671321535
commit 3c1d1432d5
9 changed files with 568 additions and 568 deletions

View File

@@ -7,10 +7,10 @@ bool CreateListNoRepeat(SqList<DT>& L, int n)
int i;
if (n > L.size)
{
cout << "元素个数大于表长,不能创建!" << endl;
cout << "元素个数大于表长,不能创建!" << endl;
return false;
}
cout << "请依次输入" << n << "个元素值:" << endl;
cout << "请依次输入" << n << "个元素值:" << endl;
for (i = 1; i <= n; i++)
{
int temp;
@@ -53,22 +53,22 @@ int main()
InitList(A, 32);
InitList(B, 32);
int length_a, length_b;
cout << "请输入集合A的元素个数: ";
cout << "请输入集合A的元素个数: ";
cin >> length_a;
CreateListNoRepeat(A, length_a);
cout << "请输入集合B的元素个数: ";
cout << "请输入集合B的元素个数: ";
cin >> length_b;
CreateListNoRepeat(B, length_b);
cout << "集合A: ";
cout << "集合A: ";
DispList(A);
cout << "集合B: ";
cout << "集合B: ";
DispList(B);
Union(A, B);
cout << "AB: ";
cout << "AB: ";
DispList(A);
A.length = length_a; // Reset A to its original length
Intersection(A, B);
cout << "A∩B: ";
cout << "A∩B: ";
DispList(A);
DestroyList(A);
DestroyList(B);