题解列表
1026-数字逆序输出
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[10]; for(int i=0;i<10;i++) ……
1026-数字逆序输出 (reverse函数) 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int a[10]; for(i……
1025-数组插入处理 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[10],n; for(int i=0;i<9;i++) ……
最大公约数与最小公倍数
摘要:解题思路:首先找出两个数字的大小并将其分开赋值给相应的变量,以便区分大小;两个数最大公约数的范围在 1-最小值 之间;两个数最小公倍数的范围在 最大值-最小值*最大值 之间;注意事项:参考代码:#in……
筛选n以内的素数,并且输出结果
摘要:解题思路:先判断两个数字能不能相互整除,如果能整除那就再次判断相不相等;然后再输出结果注意事项:参考代码#include<stdio.h>int main(){ int i = 2; in……
利润计算(if...else)
摘要:解题思路:使用if...else完成注意事项:参考代码:#include <stdio.h>
int main() {
int yield;
int reward;
……
1024-矩阵对角线求和 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[3][3]; for(int i=0;i<3;i++) ……
1023-选择排序 语言:C++
摘要:解题思路:注意事项:参考代码:/*从小到大选择排序:每一次从待排序数列中找出最小的数。 */#include<iostream>using namespace std;int main(){ int ……
1022-筛选N以内的素数 语言:C++
摘要:解题思路:注意事项:参考代码:/*素数的特点:1) 因数只包含1和自己2) 1不是素数 表达式:1) 运算符+数据 或 数据2) break语句不是表达式,所以break语句不能作为逗号表达式中的一个……