摘要: treeset为有序的集合,不含重复元素且有序 import java.util.*;//引用全部 public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 阅读全文
posted @ 2021-03-25 18:12 漂流海上的草帽 阅读(203) 评论(0) 推荐(0)
摘要: 直接上代码: #include <iostream> #include <set> using namespace std; int N; set<int> s; int main() { int a; while (cin >> N) { for (int i = 0; i < N; i++) { 阅读全文
posted @ 2021-03-25 18:01 漂流海上的草帽 阅读(204) 评论(0) 推荐(0)
摘要: Arrays即数组,长度不可变,但一般定义时直接使用如下方式定义就好: int[] num=new int[100];int[] num=new int[]{1,2,3,4};String[] aArray = new String[5];//每一元素都是字符串的数组//数组一定要初始化(使用new 阅读全文
posted @ 2021-03-25 17:04 漂流海上的草帽 阅读(88) 评论(0) 推荐(0)