题解列表

筛选

最全版 阶乘题解(迭代、递归)

摘要:解题思路:                这个题出的非常好,既可以用迭代法来求阶乘和,又可以使用函数递归来求,妙极了。                思路1(迭代法):巧妙的利用for

小白的初次尝试

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main (){ double sum=0.00,son=2.00,mom=1; int N; scanf("%d",&N); ……

求车速(超级简单C++)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int i;     for(i=95860;……

百钱百鸡问题(超级简单C++)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int i,j,k;     for(i=0;……

八皇后易懂(回溯法)

摘要:题目描述:n皇后问题是指将 n 个皇后放在 n×n 的国际象棋棋盘上,使得皇后不能相互攻击到,即任意两个皇后都不能处于同一行、同一列或同一斜线上。现在给定整数 n,请你输出所有的满足条件的棋子摆法。输……

编写题解 2850: 输出亲朋字符串

摘要:解题思路:设计两个移动指针count1,count2注意事项:参考代码:str=input() ls=[] #初始化空列表 count1=0 #设计两个相邻指针并初始化 count2=1 wh……

立方和不等式(简单C++)

摘要:解题思路:写一个立法和函数比较好看注意事项:参考代码:#include<iostream> using namespace std; int f(int n) {     int s=0; ……

素数问题(简单C++)

摘要:解题思路:素数只能被自己整除注意事项:参考代码:#include<iostream> using namespace std; int main() {     int n,i,j;    ……

自守数问题(C++)

摘要:解题思路:注意事项:int存不下,用long,题目要求两个空格隔开参考代码:using namespace std; #include<iostream> int main() {     c……