题解列表
2068: [STL训练]Ignatius and the Princess IV (C++)
摘要:解题思路: 读入,排序,最中间的数即为所求注意事项: 无参考代码:#include <iostream>
// #include <sstream>
// #include <cstdio>
#……
2809: 菲波那契数列
摘要:解题思路:注意事项:参考代码:n = [1,1]a = int(input())for i in range(0,a-1): n.append(n[i]+n[i+1])print(n[a-1])……
题解 1014: [编程入门]阶乘求和
摘要:解题思路:注意事项:参考代码import math #导入模块def main(n): #定义函数 return math.factorial(n)n = int(input())sn = ……
题解 1013: [编程入门]Sn的公式求和
摘要:参考代码:n = int(input()) i = 1sn = 0while i <= n : sn += int(str(2)*i) i += 1print(sn)……
两个for 循环搞定
摘要:解题思路:用string.h函数,变量len 来进行字符串长度的统计,确定for 语句中的范围利用变量i和变量进行循环嵌套,外循环来进行判断每个数是否在数组中有与之相同 的数如有相同数则用sum来进行……