静态方法(全局方法):既没有访问this的属性,也没有访问this的方法,是一种特殊的方法 特点:该方法可以拷贝到其他类中,它是独立的通用的 在Java中,静态方法用static修饰 例如: public class MyTest { public static boolean isPrime( i ...
分类:
其他好文 时间:
2019-01-01 13:16:41
阅读次数:
190
让我们定义d?n??为:d?n??=p?n+1???p?n??,其中p?i??是第i个素数。显然有d?1??=1,且对于n>1有d?n??是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。 现给定任意正整数N(<10?5),请计算不超过N的满足猜想的素数对的个数。 输入格式: 输入在一行 ...
分类:
其他好文 时间:
2018-12-30 22:04:03
阅读次数:
236
Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of nu ...
分类:
其他好文 时间:
2018-12-29 21:12:51
阅读次数:
209
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7 ...
分类:
其他好文 时间:
2018-12-29 19:43:18
阅读次数:
178
【题目】 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 les ...
分类:
其他好文 时间:
2018-12-28 17:15:19
阅读次数:
188
这里对lombok的@Builder和@Data组合的使用示例 class People加上了@Builder和@Data注解后,多了一个静态内部类PeopleBuilder,People调用静态方法builder生成PeopleBuilder对象,PeopleBuilder可以使用".属性名(属性 ...
分类:
其他好文 时间:
2018-12-27 00:31:56
阅读次数:
1620
章一 初识C语言一.使用C语言的4个步骤 1.功能 2.算法 3.编程 4.测试与维护二.代码运行的流程 1.编译器把源代码(.c)转化成中间代码(.obj),连接器把中间代码(目标代码)和其他代码(库代码和启动代码)合并,生成可执行文件(.exe), 2.C编译器会创建一个和源代码基本名相同的目标 ...
分类:
其他好文 时间:
2018-12-25 21:50:04
阅读次数:
130
prime 是一款基于graphql的开源cms,功能点很不错,但是出来不久,还是有好多bug的 官方暂时没有提供docker 的运行方式,为了方便测试,搞了以及docker-compose 测试的 环境准备 docker-copose 文件 version: "3" services: postg ...
分类:
其他好文 时间:
2018-12-23 22:18:32
阅读次数:
243
将开源的Nouveau驱动加入黑名单,禁止其启动; sudo vi /etc/modprobe.d/blacklist.conf 在文件末尾添加 blacklist nouveau安装驱动和Prime: sudo apt-get install nvidia-375 nvidia-settings ...
分类:
系统相关 时间:
2018-12-23 16:49:49
阅读次数:
210
为方便区分流程语句的开始和结束位置,可以使用PHP提供的替代语法进行编码。 左花括号({) 替换成 → 冒号(:) 右花括号(}) 替换成 → “endif;” "endwhile;" "endfor;" "endforeach;" "endswitch;" 质数(prime number)又称 " ...
分类:
Web程序 时间:
2018-12-22 22:42:24
阅读次数:
243