题解列表

筛选

电池的寿命

摘要:思路: 对于有1个3,1个5的情况和3,5各有奇数个的情况没得说,对于其他情况把电池当作水即可求得。参考代码为初始未优化代码,大家可以自己更近一步修改。 参考代码: ```c #inc……

2794:Hello, World!

摘要:解题思路:   直接输出Hello, World!即可。参考代码:#include<iostream>using namespace std;int main(){   cout<<"Hello, W……

分段函数(c语言)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>double fun(double x){      if(x>=0 && x<5)      {           return -……

1130一行解(Python)

摘要:解题思路:用内置函数解决问题,站在巨人的肩膀上不用再造轮子了注意事项:filter()用于筛选符合条件的对象元素,在Python中若为判断条件为True,则添加入filter类型中,用list类型打印……

2963: Tomorrow never knows?

摘要:输入的时候‘-’可以用getchar直接屏蔽掉 ```cpp #include #include using namespace std; bool IsLeapYear(int year)……

1246: 第几天

摘要:```cpp #include using namespace std; int arr[12]={31,28,31,30,31,30,31,31,30,31,30,31},sum=0; in……

1866: 三位数反转(Python)

摘要:解题思路:注意事项:参考代码:while True:     try:         n = input()         m = n[::-1]