题解列表

筛选

~~~~~~~~~~~~~~~可爱的津津乐道+++++++++++

摘要:解题思路://通过数组来存放数据,然后再拿来比较注意事项://如何判断那一天最不高兴参考代码:#include<stdio.h> int main() {     int a[8]={[0]=0……

2820: 含k个3的数

摘要:解题思路:注意事项:参考代码:a,b = map(int,input().split())c = 0for i in str(a):    if i == &#39;3&#39;:        c ……

2819: 数字反转

摘要:解题思路:注意事项:参考代码:n = int(input())if n >= 0:    s = str(n)[::-1]    print(int(s))else:    n = -n    s =……

用数学的解题方式求pi

摘要:解题思路:根据题目给出的 pi/4=1-1/3+1/5-1/7...公式 可以知道分子奇数项为1,偶数项为-1,分母是公差为2的等差数列,所以分子可以写成 -1^(n-1) ,n从1开始,分母可以写成……

2817: 级数求和

摘要:解题思路:注意事项:参考代码:k = int(input())s = 0n = 0while k >= s:    n += 1    s += 1/nprint(n)……

统计满足条件的4位数个数

摘要:解题思路:注意事项:参考代码:n = int(input())l = list(map(int,input().split()))count = 0for i in l:    a = i%10   ……

题解 2815: 求特殊自然数

摘要:解题思路:注意事项:参考代码:def switch_n(n,d):    l = []    while n > 0:        l.append(str(n % d))        n = n……

绝了,涨知识了, 科学计数法输出

摘要:解题思路:循环加递归加格式化输出注意事项:首先是变量的大小一定要用对,然后输出格式要对参考代码:#include <iostream> #include <vector> #include <io……