题解列表

筛选

电池的寿命

思路:对于有1个3,1个5的情况和3,5各有奇数个的情况没得说,对于其他情况把电池当作水即可求得。参考代码为初始未优化代码,大家可以自己更近一步修改。参考代码:```c#includeintmain(){intN;while(scanf("%d",

题目 1511: 蓝桥杯算法提高VIP-复数求和

摘要:解题思路:从键盘读入n个复数(实部和虚部都为整数)用链表存储,遍历链表求出n个复数的和并输出。注意事项:参考代码:#include<stdio.h>#include<stdlib.h>typedef ……

数字整除(python代码)

摘要:def judge(x):     c = len(x)     x = list(x)     e = int(x[c-1])     del(x[c-1])     x = &#39;&

奇偶数判断(C语言)

摘要:解题思路:从文章的‘输出格式’可以知道:如果输入的数是奇数,就输出odd,如果是偶数就输出even。一个大于0的正整数,非偶即奇。一个数除以2,没有余数的就是偶数,有余数的就是奇数。注意事项:1.输入……

2919: 奖学金

```cpp#include#includeusingnamespacestd;structstudent{intid,Chinese,score;}stu[1000];boolsort_rule(studenta,studentb){if(a.score!=b.score)returna.score

1269: 谁拿了最多奖学金

```cpp#include#include#includeusingnamespacestd;structStu{stringname;intg1,g2,wen;charbg,xb;};voidinput(Stustu[],intn){for(inti=0;i>stu[i].name>>stu[i]

#用集合来排序

解题思路:注意事项:参考代码:importjava.util.Scanner;importjava.util.ArrayList;importjava.util.Collections;importjava.util.Comparator;publicclassMain{publicstaticvoi