题解列表

筛选

只考虑对角线 1115题-DNA-题解(C++代码)

###因为数据范围较小我们只需要开一个矩阵,只考虑主对角线和次对角线就行了,除了第一行之外去掉第一行输出。```cpp#include#include#includeusingnamespacestd;intN;inta,b;ints[110][110];intmain(){cin>>N;while(

[编程入门]报数问题-题解(C++代码)

借用了一位大佬的思路,自己写了一下,仅为学习,让大家检查一下,看看有没有问题。或者有能优化的地方,欢迎指出。#include#includetypedefstructLnode{intdata;structLnode*next;}Lnode,

蛇行矩阵-题解(C++代码)

**每一行的数都等于上一行相应位置的前一个,所以先写出第一行,并不断更新**```cpp#includeusingnamespacestd;intmain(){inta[110]={1};//初始化a[0]=1intn;cin>>n;cout