题解列表

筛选

成绩排序 (C++代码)

摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct stu { ch……

蛇行矩阵 (C++代码)

摘要:每一行的规律很好看出来每行的第n个数为前n-1个数之和,很容易求出该数字为(n*n+n)/2;继续分析第m行的第n个数(n*n+n)/2+1-m;代码如下#include<iostream>using……

The 3n + 1 problem (C++代码)

摘要:数字本身也正在运行次数类,所以最后的max要加1每次循环结束记得要k归0,最大值也要归零#include<iostream>using namespace std;int main() { long ……

The 3n + 1 problem (C++代码)

摘要:解题思路:求最大循环长度注意事项:参考代码:#include <iostream>#include <cstdio>using namespace std;int main(){int m,n;whi……