题解列表

筛选

1004: [递归]母牛的故事

摘要:#include<stdio.h>  int fun(int n){     if(n<=4) return n;     else      return fun(n-1)+fun(n-3)……

1099: 校门外的树

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

1100: 采药 (c++代码)

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

题解 1783: 星期判断机

摘要:参考代码:#include<stdio.h> int main() {     int n;     scanf("%d",&n);          switch(n){      c……

4个循环的解题法

摘要:### 不说废话,直接上代码 ```c #include #define SIZE 10 int main() { int nums[SIZE] ; int count ……

利润计算——C语言

摘要:解题思路:根据题意可以分为以下六种情况:一、profit<=100000       bonus=profit*0.1;       二、100000<profit<=200000       bon……
优质题解

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

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

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

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