题解列表
使用for循环计算2的幂
摘要:因为懒得导入math.h库,就使用for循环写
```c
#include
int main()
{
int n,s=1,i;
scanf("%d",&n);
f……
2778: 判断数正负
摘要:```c
#include
int main()
{
int n;
scanf("%d",&n);
if(n>0)
printf("positive");……
超级楼梯使用动态规划算法,C++实现!
摘要:# 动态规划
```c++
#include
#include
using namespace std;
const int N = 100010;
int n, m;
int……
C++ STL next_permutation
摘要:# STL `next_permutation`
```c++
#include
#include
#include
using namespace std;
int main(……
鸡兔同笼问题(C++简单解)
摘要:假设鸡的数量为a,兔的数量为b。根据题目中给定的条件,可以列出以下方程:a + b = x (头的总数量)2a + 4b = y (脚的总数量)参考代码:#include <iostream>usin……
甲流疫情死亡率(C++简单解)
摘要:代码解析:sum通过static_cast(b)/a*100对进行强制转换就可以得到正确结果啦注意事项:要进行强制转换,要不然你的b/a*100,会出现0的情况。参考代码:#include<iostr……
自定义函数之字符提取,很完全
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>void Vowel(char str[]){ int i = 0, j = 0; ch……