题解列表

筛选

1101: 循环(c++纯代码)

摘要:这第75行真是把我搞晕了,虽然最后过了,但还是不懂字符数组为啥用gets输入有问题。 ```cpp #include #include using namespace std; int xx……

二级C语言-计负均正(C++版)

摘要:解题思路:根据题意,首先需要定义一个长度为20的数组来保存20个整数,然后定义sum保存所有正数的和,aver保存所有正数的平均值。再定义num保存负数的个数,接着用for循环依次输入20个数(这里为……
优质题解

二级C语言-同因查找(C++版)

摘要:解题思路:首先利用for循环依次获取从10到1000之间的所有整数,然后在循环里面进行判断,判断当前的整数是否能同时被2,3,7整除。用%(取余运算符)进行计算,先依次进行判断,计算表达式如下:i%2……

1100: 采药 (c++代码)

摘要:```cpp #include using namespace std; const int maxn=110,tmaxn=1010; int cost[maxn],value[maxn],d……

1099: 校门外的树

摘要:```cpp #include #include using namespace std; int main() { char L[10001]; memset(L,0,……

二级C语言-进制转换

摘要:解题思路:将十进制数转化为八进制有两种方式一、使用C中的printf函数,用占位符%o输出(%o表示以八进制整数形式输出),代码如下:printf("%o",n);二、使用iostream的格式控制字……

编写题解 2780: 奇偶数判断

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

编写题解 2779: 输出绝对值

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