计算机语言
YesterdayLee
这个作者很懒,什么都没留下…
展开
-
2021-3-30 Java基础错题总结笔记
1、关于泛型(1)虚拟机中没有泛型,只有普通类和普通方法(2)所有泛型类的类型参数在编译时都会被擦除(3)创建泛型对象时应指明类型,让编译器尽早的做参数检查(4)泛型虽有类型擦除机制,能够在运行时使用反射机制动态地获取泛型的实际类型。详细总结:1、创建泛型对象的时候,一定要指出类型变量T的具体类型。争取让编译器检查出错误,而不是留给JVM运行的时候抛出类不匹配的异常。 2、JVM如何理解泛型概念 —— 类型擦除。事实上,JVM并不知道泛型,所有的泛型在编译阶段就已经被处理成了普通类和方法。 处理方原创 2021-04-22 14:05:04 · 351 阅读 · 0 评论 -
C++标准模板库(STL)整理之set
setset即集合,是一个内部自动有序而且不含有重复元素的容器。set的定义方式与vector相同,详情可见vector整理除了vector和string之外的STL容器都不支持(it+i)的访问方式,只能用*it的方式取出该位置元素*set内的元素自动递增排序,而且自动去除重复元素set常用函数实例解析(1)insert()(2)find()find(value)返set中对应值为value的迭代器,时间复杂度为O(logN),N为set内的元素个数。set最主要的作用是自动去重并按原创 2020-11-04 10:32:15 · 158 阅读 · 0 评论 -
C++标准模板库(STL)整理之vector
vectorvector也叫变长数组,即“长度根据需要而自动改变的数组”。在编写C++程序时使用vector,需要加上以下头文件和语句:#include<vector>using namespace std;1.vector的定义vector<typename> name;其中typename指的是类型,name则指变长数组名。在使用时,typename可以是int,double,char等任意的基本类型,也可以是结构体类型,除此之外,还可以是STL标准容器,如vect原创 2020-10-30 17:31:34 · 220 阅读 · 0 评论 -
PAT甲级 1011 World Cup Betting (20分)
1011 World Cup Betting (20分)1.题目描述With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football be原创 2020-10-15 23:43:37 · 200 阅读 · 0 评论 -
PAT 甲级1005 Spell It Right (20分)
PAT 甲级1005 Spell It Right (题目详情Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line原创 2020-10-15 13:58:44 · 115 阅读 · 0 评论 -
PAT甲级 1001 A+B Format (20分)
PAT甲级 10011 A+B Format (20分)题目描述Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test c原创 2020-10-13 11:31:59 · 134 阅读 · 0 评论