📄 testset.java
字号:
import java.io.*;
public class TestSet
{
public static void main(String[] args)
{
int a=0,b=0;
String digit;
int test=1;
Set sa=null;
Set sb=null;
Set sc=null;
Set sd=null;
System.out.println("集合A的大小:");
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
digit=br.readLine( );
a=Integer.parseInt(digit);
}catch(IOException e){}
System.out.println("集合B的大小:");
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
digit=br.readLine( );
b=Integer.parseInt(digit);
}catch(IOException e){}
sa=new Set(a);
sb=new Set(b);
sc=sa;sd=sb;
System.out.println("集合A: "+sa);
System.out.println("集合B: "+sb);
sa.unite(sb);
System.out.println("集合A并B:"+sa);
sc.intersection(sd);
System.out.println("集合A交B:"+sc);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -