题解列表
1021-迭代法求平方根 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath> using namespace std;int main(){ int n; cin >>n; dou……
编写题解 1004: [递归]母牛的故事
摘要:import java.util.Scanner;
public class Main {
public static void main(String[] args) {
……
1022-筛选N以内的素数 语言:C++
摘要:解题思路:注意事项:参考代码:/*素数的特点:1) 因数只包含1和自己2) 1不是素数 表达式:1) 运算符+数据 或 数据2) break语句不是表达式,所以break语句不能作为逗号表达式中的一个……
1023-选择排序 语言:C++
摘要:解题思路:注意事项:参考代码:/*从小到大选择排序:每一次从待排序数列中找出最小的数。 */#include<iostream>using namespace std;int main(){ int ……
筛选n以内的素数,并且输出结果
摘要:解题思路:先判断两个数字能不能相互整除,如果能整除那就再次判断相不相等;然后再输出结果注意事项:参考代码#include<stdio.h>int main(){ int i = 2; in……
1025-数组插入处理 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[10],n; for(int i=0;i<9;i++) ……
1026-数字逆序输出 (reverse函数) 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int a[10]; for(i……
1026-数字逆序输出
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[10]; for(int i=0;i<10;i++) ……
1027-自定义函数处理最大公约数与最小公倍数 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int maxFac(int m,int n){ if(……