2902:输出最高分数的学生姓名 python实现(极简方法) 摘要:解题思路:本来想保存最大值,然后找对应的名字,后面发现找到最大值的时候可以直接用student保存学生的名字,最后直接输出该名字即可。注意事项:没有用到字典。参考代码:n = int(input())…… 题解列表 2023年12月06日 1 点赞 0 评论 223 浏览 评分:0.0
n阶Hanoi塔问题 摘要:解题思路:注意事项:参考代码:def hanoi(n, a, b, c, count): if n > 0: count = hanoi(n-1, a, c, b, count) …… 题解列表 2023年12月06日 0 点赞 0 评论 167 浏览 评分:0.0
三个数比较大小 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int *bigger(int *a, int *b){ if(*a >= *b) { return a; …… 题解列表 2023年12月06日 0 点赞 0 评论 97 浏览 评分:0.0
分段函数求值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; while(~scanf("%d", &a)) { if(a < …… 题解列表 2023年12月06日 0 点赞 0 评论 219 浏览 评分:0.0
括弧匹配检验 摘要:解题思路:注意事项:参考代码:def is_matching(expression): stack = [] mapping = {')': '(', &#…… 题解列表 2023年12月06日 0 点赞 0 评论 303 浏览 评分:0.0
自定义函数之字符串拷贝 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char str1[100],str2[100]; int m, n,i,j; scanf("%d", &n);…… 题解列表 2023年12月06日 0 点赞 0 评论 244 浏览 评分:0.0
乖孩子的直接思路 摘要:解题思路:在//后面就是思路注意事项:参考代码:#include <stdio.h>int main(){int a[5][5];int i,j,t,r,s;for(i=0;i<5;i++)for(j…… 题解列表 2023年12月07日 0 点赞 0 评论 165 浏览 评分:0.0
筛选N以内的素数 摘要:解题思路:注意事项:参考代码:def is_prime(num): if num < 2: return False for i in range(2, int(num **…… 题解列表 2023年12月07日 0 点赞 0 评论 121 浏览 评分:0.0
百钱百鸡问题 摘要:解题思路:注意事项:参考代码:def buy_chicken(): solutions = [] # 存储所有解的列表 for cock in range(0, 21): # 公鸡的取…… 题解列表 2023年12月07日 0 点赞 0 评论 158 浏览 评分:0.0
哥德巴赫曾猜测 摘要:解题思路:注意事项:参考代码:# 判断是否是素数def is_prime(n): if n < 2: return False for i in range(2, int(n…… 题解列表 2023年12月07日 0 点赞 0 评论 141 浏览 评分:0.0