1852: 求1+2+3+...+n的值 摘要:解题思路:用for循环,从1累加到n。注意事项:n<=1000000000,变量得开long long。参考代码:#include<bits/stdc++.h>using namespace std;…… 题解列表 2024年07月30日 0 点赞 0 评论 176 浏览 评分:0.0
c++的compare就是c的strcmp 摘要:#include<bits/stdc++.h> using namespace std; int main() { string s[3]; cin>>s[0]>>s[1]>…… 题解列表 2024年07月30日 0 点赞 0 评论 185 浏览 评分:0.0
STL句子拆分成单词 摘要:#include<bits/stdc++.h> using namespace std; set<string>s; int main() { string str,c; …… 题解列表 2024年07月30日 0 点赞 0 评论 191 浏览 评分:0.0
8行:帅破天际 摘要:解题思路:注意事项:参考代码:wlb=[]for i in range(5): row=input() wlb.append(row)n,m=map(int,input().split()…… 题解列表 2024年07月30日 1 点赞 0 评论 563 浏览 评分:9.9
~~~~~~~~~~~~~~~可爱的津津乐道+++++++++++ 摘要:解题思路://通过数组来存放数据,然后再拿来比较注意事项://如何判断那一天最不高兴参考代码:#include<stdio.h> int main() { int a[8]={[0]=0…… 题解列表 2024年07月30日 0 点赞 0 评论 231 浏览 评分:9.9
2820: 含k个3的数 摘要:解题思路:注意事项:参考代码:a,b = map(int,input().split())c = 0for i in str(a): if i == '3': c …… 题解列表 2024年07月30日 0 点赞 0 评论 198 浏览 评分:0.0
2819: 数字反转 摘要:解题思路:注意事项:参考代码:n = int(input())if n >= 0: s = str(n)[::-1] print(int(s))else: n = -n s =…… 题解列表 2024年07月30日 0 点赞 0 评论 208 浏览 评分:0.0
2818: 分离整数的各个数位 摘要:解题思路:注意事项:参考代码:n = str(input())for i in range(len(n)-1,-1,-1): print(n[i],end=" ")…… 题解列表 2024年07月30日 0 点赞 0 评论 256 浏览 评分:0.0
用数学的解题方式求pi 摘要:解题思路:根据题目给出的 pi/4=1-1/3+1/5-1/7...公式 可以知道分子奇数项为1,偶数项为-1,分母是公差为2的等差数列,所以分子可以写成 -1^(n-1) ,n从1开始,分母可以写成…… 题解列表 2024年07月30日 1 点赞 0 评论 218 浏览 评分:0.0
2817: 级数求和 摘要:解题思路:注意事项:参考代码:k = int(input())s = 0n = 0while k >= s: n += 1 s += 1/nprint(n)…… 题解列表 2024年07月30日 0 点赞 0 评论 207 浏览 评分:0.0