题目要求
P1498题目链接
建议阅读 d a l a o dalao dalao使用杨辉三角想到的思路,我的题解是照着他的思路重写的,实测AC,这人确实思路炸裂般的强啊!
我就不多说了,看他的思路就行,强的一批。
关于下面的代码,虽然以前是这么写了,但还是建议把i%2==1
改成位运算,另外是选择 ==0 会比较靠谱,详见 → 《Java运算那些坑》,养成良好习惯啊!
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
scanner.close();
int[] array = new int[1
关注
打赏
热门博文
- 【Linux】Ubuntu20.04安装和卸载MySQL8
- 【Linux】Ubuntu 20.04 报错 curl: (23) Failure writing output to destination 的解决方法
- 【Java】JUnit 4.13.2 警告 ‘assertEquals(double, double)‘ is deprecated 的解决方法
- 【JavaScript】处理 @parcel/transformer-js: Browser scripts cannot have imports or exports.
- 【Node.js】Windows环境安装配置NVM和Node.js
- 【Python】处理TypeError: Plain typing.NoReturn is not valid as type argument
- 【Python】Matplotlib可视化50例
- 【C语言】C语言修改MySQL数据库
- 【Java】从默认包导入类和对象报错的解决方法
- 【Java】panel.getGraphics()报错空指针异常的解决方法