-计算一个整数N的阶乘 摘要:解题思路:注意事项:参考代码:n=int(input())sum=1for i in range(1,n+1): sum=sum*iprint(sum) &nbs…… 题解列表 2025年03月11日 1 点赞 0 评论 647 浏览 评分:0.0
这个代码简单些 摘要:解题思路:注意事项:可以输入输出多组数据,列题有误导,所以要加上跳出条件参考代码:while True: try: n=…… 题解列表 2025年03月11日 0 点赞 0 评论 936 浏览 评分:0.0
1049: [编程入门]结构体之时间设计 摘要:```c#include struct Data{ int year; int month; int day;}; int main() { struct…… 题解列表 2025年03月12日 1 点赞 0 评论 1075 浏览 评分:0.0
一目了然- 亲和数用while、for 摘要:解题思路:注意事项:参考代码:#include<iostream>usingnamespacestd;intmain(){ int&nb…… 题解列表 2025年03月12日 0 点赞 0 评论 710 浏览 评分:0.0
考虑质数与非质数两种情况即可 摘要:只能切下质数长度的木段,且1和0直接判断先手的人输,不妨直接设置一个数组a[100010]来表示结果,1.输入n,若n为质数,a[n]=1;2.若n不是质数,我们就需要考虑比n小的质数,如果有…… 题解列表 2025年03月12日 3 点赞 0 评论 972 浏览 评分:0.0
1051: [编程入门]结构体之成绩统计2 摘要:```c#include struct student{ char id[100]; char name[100]; int a; int b; int c;}; …… 题解列表 2025年03月12日 0 点赞 0 评论 1035 浏览 评分:0.0
刚学STL的小白 解题思路:注意事项:参考代码:#includeusingnamespacestd;mapmp;inta,b=1000;intmain(){strings;cin>>s;for(inti=0;i 题解列表 2025年03月12日 0 点赞 0 评论 595 浏览 评分:0.0 信息学奥赛一本通T1499-最短路计数 堆优化+dijkstra 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"usingnamespacestd;#definell&nb…… 题解列表 2025年03月12日 1 点赞 0 评论 792 浏览 评分:0.0 sort练习---python 解题思路:注意事项:参考代码:n,m=map(int,input().split())l=list(map(int,input().split()))#要把列表中的数设为Int型,才能适应sort()l.sort()l.reverse()foriinrange(m):print(l[i], 题解列表 2025年03月12日 0 点赞 0 评论 501 浏览 评分:0.0 c++求后序遍历 解题思路:先序第一位肯定是根节点,在中序中找到根节点位置后可以推出左边孩子梳理与右边孩子数量,递归后左边孩子变成根再推此根的左边孩子........这就很容易推出中序递归左孩子范围肯定是inorder.begin~rootindex-1右孩子就是rootindex+1~inroder.end嘛先序就根 题解列表 2025年03月13日 0 点赞 0 评论 622 浏览 评分:0.0 « 12...5778577957805781578257835784...59115912 »
信息学奥赛一本通T1499-最短路计数 堆优化+dijkstra 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"usingnamespacestd;#definell&nb…… 题解列表 2025年03月12日 1 点赞 0 评论 792 浏览 评分:0.0
sort练习---python 解题思路:注意事项:参考代码:n,m=map(int,input().split())l=list(map(int,input().split()))#要把列表中的数设为Int型,才能适应sort()l.sort()l.reverse()foriinrange(m):print(l[i], 题解列表 2025年03月12日 0 点赞 0 评论 501 浏览 评分:0.0
c++求后序遍历 解题思路:先序第一位肯定是根节点,在中序中找到根节点位置后可以推出左边孩子梳理与右边孩子数量,递归后左边孩子变成根再推此根的左边孩子........这就很容易推出中序递归左孩子范围肯定是inorder.begin~rootindex-1右孩子就是rootindex+1~inroder.end嘛先序就根 题解列表 2025年03月13日 0 点赞 0 评论 622 浏览 评分:0.0