摘要:
带遍历 public class Test4 { public static void main(String[] args) { HashMap<Phone,String> map = new HashMap<>(); map.put(new Phone("Apple",7000),"美国"); 阅读全文
摘要:
dict1={'name':'Lara','age':18} #判断键在不在字典中 for one in dict1: if 'name' in dict1:#或dict1.keys() print('key在字典中!') break #判断值在不在字典中 for one in dict1: if 阅读全文
摘要:
用法见代码: `#include #include std::set s; using namespace std; int main() { int n; while (cin>>n) { int a; for(int i=0;i<n;i++) { cin>>a; s.insert(a); } s 阅读全文
摘要:
treeset为有序的集合,不含重复元素且有序 import java.util.*;//引用全部 public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 阅读全文
摘要:
直接上代码: #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++) { 阅读全文