题解列表

筛选

冒泡排序法C语言

摘要:解题思路:冒泡排序法注意事项:注意i和j的使用。参考代码:#include<stdio.h>#include<stdlib.h>int main(){    int n,num[100];    in……

这个方法还不错!

摘要:解题思路:对于本体解法,这里将运用结构体struct将10个数从大到小依次排列注意事项:malloc参考代码:#include<stdio.h> #include<malloc.h> #defin……

递归法求最大公约数

摘要:最大公约数,采用辗转相除法,即对于a y) { c = x % y; if (c)return yue(y, c); else return y;……

C语言 自定义函数&

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>#define LONG 10int main(){         double fact(int……

自定义函数处理素数(简单易懂)

摘要:解题思路:定义一函数判断参数(x)是否为素数,是素数则返回0,否则返回1判断方法:若x能整除2到x-1中的任意一个数则x不是素数(当x=2不做判断)构建循环遍历2到x-1的数(循环变量为i) 让x除以……

救援(数学解题法)

摘要:解题思路:注意事项:注意有多个屋顶,时间需要累加参考代码:#include<stdio.h>#include<math.h>int main(){ int n,x,y,s; float l,t=0; ……

C语言:二维数组转置(行列换)

摘要:解题思路:输入和输出矩阵行列呼唤注意事项:输入是先确定行,输出时先确定输入时的列。参考代码:#include<stdio.h>int main(){ int a[3][3]; int i,j; for……

简洁易懂,快来学吧

摘要:解题思路:这里用到选择查找法注意事项:注意这里的位置号不是数组下标,数组下标是0开始的,应该是下标加1参考代码:#include <stdio.h>int main(){ int a[100]; in……

简单易懂,快来学吧!

摘要:解题思路:注意事项:小心等号和赋值号混淆参考代码:#include <stdio.h>int main(){     int n;     int i, j;     scanf("%d", &n);……

平均值计算

摘要:参考代码 #include int main(void) { int arr[10], x = 0; double sum = 0, ava; f……