题解列表

筛选

来个C++的题解

摘要:解题思路:以先序遍历为基础,找到root后在中序遍历中找root的位置并设置好范围len,变换pre和in数组的head指针参考代码:#include<bits/stdc++.h>#define re……

行程长度编码

摘要:解题思路:按着上一道题修改即可注意事项:参考代码:myStr=input().strip()myStr1=""i=1for t in range(len(myStr)-1):    if myStr[……

1061: 二级C语言-计负均正

```pythonli=list(map(int,input().split()))li1=list(map(int,input().split()))#题中示例是两行输入li.extend(iforiinli1)#读取两行数据后,再拼接在一起即可fu_num=0zheng_sum=0foriinli

1063: 二级C语言-统计字符

```pythonss=input()#英文字母、空格、数字和其它字符alpha,space,num,other=0,0,0,0foriinss:ifi.isalpha():alpha+=1elifi.isspace():space+=1elifi.isnumeric():num+=1else:oth

1074: 数字整除

```pythonn=int(input())#初始值whilen!=0:#n=0时停止lest=n//10if(lest-(n%10)*5)%17==0:print('1')else:print('0')n=int(input())```

不能没落的strcmp和strcpy!!!

解题思路:strcmp函数:若返回值为0,说明两个字符串相等。若返回值小于0,说明str1小于str2。若返回值大于0,说明str1大于str2。作用:用于比较两个字符串。函数原型:intstrcmp(constchar*str1,constchar*str2);返回值:返回一个整数,表示比较的结果。

1073: 弟弟的作业

摘要:```python score = 0 while True: try: user = input().split("=") if user[1] =……