题解列表

筛选

C语言求偶数和

摘要:解题思路:循环和条件判断语句的使用注意事项:写了两种,一种就是不需要输入整数个数n(输入以回车结束),另一种是需要输入整数个数n(就是本题)参考代码:第一种:#include<stdio.h>int ……

【C语言题解】 C语言循环移位

####思路![](https://t.tutu.to/img/8i38z)-分别获取两部分1.右移n位,得到![](https://t.tutu.to/img/8iQne)2.左移(32-n)位得到![](https://t.tutu.to/img/8icWk)-新得到的两个数进行异或运算`^`与0

1157: 亲和数

```cpp#includeusingnamespacestd;intqhs(intx,inty){inta=0,b=0;for(inti=1;i

一元二次方程--------------C语言

摘要:解题思路:利用求根公式注意事项:导入数学库<math.h>参考代码:#include <stdio.h> #include <math.h> int main() { float a, b,……

使用按位与运算求解委派任务

摘要:方法1:使用按位与运算假设0表示不去,1表示去,很显然这是一个二进制数,因此可以使用按位与运算求解,如果二进制数#include int main() {     int a, b, c, d, ……

利用数组的方法

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#include<vector>int main() { int m = 0; cin >> ……