题解列表
python二分法求函数零点
摘要:参考代码:def compute(x): return pow(x,5)-15*pow(x,4)+85*pow(x,3)-225*pow(x,2)+274*x-121def num(l,r): ……
python通过位运算计算二进制中1的数量
摘要:解题思路:#返回n的最后一位1def lowbit(x): return x&(-x)参考代码:l,r=map(int,input().split())def lowbit(n): ret……
python位运算解二进制分类1的个数相关问题
摘要:解题思路:lowbit函数用于返回n的最后一位1参考代码:def lowbit(n): return n&(-n)a=0b=0for i in range(1,1001): j=0 ……
简单方法(两个循环比较)
摘要:```c
#include
#include //strlen函数需要调用
int main()
{
char str[100001],out;
int len, sum;……
基因相关性(两个数组的相似比例)
摘要:```c
#include
#include //要用到strlen函数
int main()
{
char a[501], b[501];
float sim;
……
二级C语言-公约公倍 (用c写的) 简单步骤!!!!!
摘要: #include
int gcd(int c,int d)
{
if(c%d==0)
return d;
else gcd(d,c%d……
2847: 找第一个只出现一次的字符
摘要:解题思路:注意事项:参考代码:#include <stdio.h>
#include <string.h>
int main()
{
char a[100000] = {0};
int ……
3020: 最大数位置
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#define N 1001int main(){int a[N],max,p=0,n;a[0]=0;scanf("%d",&n);in……
1738: 排序(C语言)
摘要:解题思路:冒泡排序算法暴力解决。注意事项:注意空格和多组输入。参考代码:#include<stdio.h>#define N 101int main(){ int a[N],n,t=0; int j,……