题解列表

筛选

二级C语言-公约公倍

摘要:解题思路:参考链接:用更相减损术求解最大公约数与最小公倍数-Dotcpp编程社区注意事项:参考代码:#include<iostream>using namespace std;int temp;//定……

for循环求解计负均正

摘要:解题思路:利用for循环拿到输入的所有数,放到数组中在拿到数的同时进行题目要求的操做,最后输出即可注意事项:参考代码:#include<iostream>using namespace std;int……

for循环求解同因查找

摘要:解题思路:利用for循环遍历范围数利用if判断是否符合条件输出符合条件的数注意事项:每行输出一个参考代码:#include<iostream>using namespace std;int main(……

1056: 二级C语言-温度转换

按公式来就行**注意事项:要乘1.0!!!**##**代码**```cpp#include#includeusingnamespacestd;intmain(){inta;cin>>a;doubled=(a-32)*5*1.00000/9;printf("%.2lf",

for循环求解等差数列

摘要:解题思路:利用for循环求解此题即可注意事项:参考代码:#include<iostream>using namespace std;void dfs(int a){    int b = 2;    ……

利用数组求偶数和

摘要:解题思路:使用数组来记录输入的数据,记录完成后再判断是否为偶数并输出偶数和即可注意事项:参考代码:#include<iostream>using namespace std;void dfs(int ……

sort排序,c++

摘要:解题思路:用sort排序解题注意事项: 注意但m<2时,不能进入for循环判断,会默认为质数参考代码:#include<iostream>#include <algorithm>using names……

求解分段函数

摘要:解题思路:使用if,else if即可解决此题注意事项:输出时需要保留两位小数参考代码:#include<iostream>using namespace std;void dfs(float a)/……

求解温度转换

摘要:解题思路:在代码中调用公式解此题即可注意事项:输出结果需要保留小数点后两位参考代码:#include<iostream>using namespace std;void dfs(float a){  ……

1053: 二级C语言-平均值计算

##**思路**遍历两遍即可。第一遍求平均值,第二遍求个数。##**代码**```cpp#includeusingnamespacestd;inta[10005];intmain(){intn=10;doublecnt=0,sum=0;for(inti=1;i>a[i];sum+=a[i];}sum/