Initial commit

This commit is contained in:
toly
2023-04-16 10:28:45 +08:00
commit a1465d4a52
139 changed files with 5073 additions and 0 deletions

30
test/aggregation/set.dart Normal file
View File

@@ -0,0 +1,30 @@
void main() {
foo3();
}
void foo1() {
Set<int> numSet = {1, 9, 9, 4};
print(numSet);
}
void foo2() {
Set<int> numSet = {1, 9, 4};
numSet.add(10);
numSet.remove(9);
print(numSet);
}
void foo3() {
Set<int> a = {1, 9, 4};
Set<int> b = {1, 9, 3};
print(a.difference(b));// 差集
print(a.union(b)); // 并集
print(a.intersection(b)); // 交集
}
void foo4() {
Set<int> numSet = {1, 9, 4};
for(int value in numSet){
print("元素值:$value");
}
}