题解列表

筛选

C++2784开瓶盖赢大奖题解

摘要:解题思路:注意事项:参考代码:#includeusing namespace std;int main(){    int a;cin >>a;    if (a>=10||a>=20)    {  ……

编写题解 1110: 2^k进制数

```cpp#include#includeusingnamespacestd;intpr,max2,tot=0;voiddp(intbit,intn){if(bit>1&&bit>k>>w;pr=w/k+1;max2=pow(2,w%k)-1;max=pow(2,k)-1;for(inti=2;i

2865: 紧急措施(结构体+函数解法)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<ctype.h>// 函数arr用于将字符串中的大写字母转换为小写字母,小写字母转……

蓝桥杯2018年第九届真题-约瑟夫环-题解(C++代码)简单理解的进一步解释

解题思路:大佬的代码逻辑太强,对此作进一步的解释说明此代码运用的其实是一种从后往前倒推的思想,我们先假设最后一个人的位置为0,即s=0,所以s+m即为倒数第二个人的报数位置,以此类推,直到推出第一个人的报数位置,同时,这种方法的妙处在于它利用了报数问题的对称性和周期性,

直接写就得了

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    float a,b;    scanf("%f %f",&a,&b);    printf("%.2f",……

紧急措施(详细注释)

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义结构体aaa,包含三个字符数组a, b, c struct aa……

新手较简单的数组方法

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[55]; int i; a[0]=1;a[1]=2;a[2]=3;a[3]=4; for(i=4;i……

直接写就行了

摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<math.h> int main() {      int i,j=0,n,Sn=0;     scanf……