题解列表
编写题解 1009: [编程入门]数字的处理与判断
摘要:解题思路:利用strlen函数求出数组有效大小,即数字位数。再利用swich选择语句根据不同位数来进行输出注意事项:注意加上头文件#include<string.h>#include<iostream……
1067: 二级C语言-分段函数(c++题解)
摘要:解题思路:x<0时求绝对值,x>=0并<2时求(x+1)的平方根,x>=2并<4时求(x+2)的5次方,否则求2x+5。注意事项:保留2位小数参考代码:#include <bits/stdc++.h>……
C++ 猴子偷逃问题
摘要: //整体思路:反向推理
#include
using namespace std;
int main()
{
int N;int s = 1;//表示桃子的数量
……
琴海——计负均正——
摘要:解题思路:注意事项:参考代码:#include <stdio.h>
void main()
{
int i=0,a;
int neg=0,pos=0;
float s……
思路很简单,代码很友好(注释),也很短
摘要:解题思路:1.如果是*直接输出,else就考虑相邻元素,这里的相邻元素是核心,可以先考虑同一行和同一列的相邻元素(曼哈顿距离)abs(i - x) + abs(j - y) < 2 // 上下左右的相……
C++ 数据结构 字符串连接
摘要: #include
#include
using namespace std;
int main()
{
string a,b;
string c[3];
f……