【编程入门】迭代法求平方根-题解(python) 摘要:解题思路: 根据所给公式写出相应代码,因为要迭代,所以利用python复合赋值。注意事项: 格式化输出保留三位小数。参考代码:x = int(input())a = x/2b = (a+x/a…… 题解列表 2022年01月24日 0 点赞 0 评论 397 浏览 评分:8.0
2191: Little Xie's issue(python代码) 摘要:解题思路:注意事项:参考代码:n = input() print('*'*(len(n)+4)) print('* '+n+' *') print…… 题解列表 2022年01月24日 0 点赞 0 评论 325 浏览 评分:0.0
python-矩阵加法 摘要:解题思路:注意事项:注意题目要求最后一行不要有多余空格参考代码:def f(n,m): A = [[int(j) for j in input().strip().split()] fo…… 题解列表 2022年01月24日 0 点赞 0 评论 388 浏览 评分:0.0
2190: Little Ke's problem 摘要:解题思路:注意事项:参考代码:n = input() print(f"What is your name? Hello {n}, nice to meet you.")…… 题解列表 2022年01月24日 0 点赞 0 评论 302 浏览 评分:0.0
2189: diamond(python代码) 摘要:解题思路:注意事项:参考代码:n = int(input()) m = 1 for i in range(n//2): print(' '*((n-m)//2)+'…… 题解列表 2022年01月24日 0 点赞 0 评论 251 浏览 评分:0.0
A+B for Input-Output Practice (V) 摘要:解题思路:两层for循环,用数组存储相加所需数字注意事项:参考代码:#include<iostream>using namespace std;int main(){ int row, n;//row…… 题解列表 2022年01月24日 0 点赞 0 评论 235 浏览 评分:0.0
Benjam1n:蓝桥杯算法提高VIP-铺地毯(Java代码) 摘要:# 铺地毯(Java) **为了不判断所有点的铺地毯情况,而只判断题中所求点(即代码中的x、y)的铺地毯情况,我们采取先读取所有坐标及长度后再判断而非边读取边判断。时间复杂度O(n),空间复杂度…… 题解列表 2022年01月24日 0 点赞 0 评论 405 浏览 评分:9.9
python-新生舞会 摘要:解题思路:开始想的是用对象解决,但是查询遍历的时间复杂度将达到O(n2),想想便放弃了,然后采用字典的方法,时间复杂度为O(n)。建立两个字典第一个字典键值为名字,值为性别第二个字典键值为学号,值为性…… 题解列表 2022年01月24日 0 点赞 0 评论 330 浏览 评分:0.0
1133: C语言训练-求1+2!+3!+...+N!的和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int n,i,j;long b=0,a=1;int fun1(int n){ a=1; if(n==1) { …… 题解列表 2022年01月24日 0 点赞 0 评论 289 浏览 评分:0.0
蓝桥杯2014年第五届真题-分糖果(C语言代码) 摘要:# 分糖果 **分析** - 代码主要包括2个方面,一是判断每个人的糖果是否相同 - 二是分糖果的过程:用s1数组来表示存储减半的糖果数,判断糖果是否满足奇数,满足就补糖果 - 以下就…… 题解列表 2022年01月24日 0 点赞 0 评论 450 浏览 评分:9.9