题解列表

筛选

逆向思维考虑,五行代码解决!!!

摘要:解题思路:首先审题发现要求猴子第一天摘的桃子数,每天吃前一天的(一半+1)个,第N天还剩1个。最后一天是没有吃的,所以往回推第N-1天的桃子为1*2个,第N-2天就是(1*2+1)*2个.......……

编写题解 2837: 年龄与疾病

摘要:解题思路:1)定义4个count计数器2)输出%:'%.2f%%'%n注意事项:参考代码:n=int(input()) #病人数目 ages=list(map(int,input()……

不知道为什么运行错误

摘要:解题思路:先构建1,2,3,5,8******这个数列存在malloc出来的数组里,再进行后一项除前一项操作注意事项:进行除法,注意强制类型转换,需要对每一个int都转参考代码:#include <s……

编写题解 2846: 统计数字字符个数

摘要:解题思路:str.isdigit(),判断字符是否为数字注意事项:参考代码:n=input() count=0 for i in n:     if i.isdigit(): #判断字符是否为数……

简单的数学题

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;ll x,y;int main(){   ……

自定义函数(C++)

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

没人写,就我来吧。

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n,t,b[1005]={0}; cin>>n; i……

1157: 亲和数

摘要:```cpp #include #include using namespace std; int main() { int i,M,j,k; cin>>M; ……