最短代码解决奇偶数之和 摘要:解题思路:使用求和公式。偶数求和公式为(n / 2) * (n / 2 + 1),奇数求和公式为(n / 2) * (n / 2)或(n / 2) * (n / 2)+n。注意事项:奇数和与偶数和求和…… 题解列表 2024年07月31日 0 点赞 0 评论 155 浏览 评分:9.9
编写题解 1809: [编程基础]输入输出练习之精度控制2 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ double x; cin >> x; printf(…… 题解列表 2024年07月31日 0 点赞 0 评论 165 浏览 评分:0.0
编写题解 1808: [编程基础]输入输出练习之精度控制1 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ double a; cin>>a; pr…… 题解列表 2024年07月31日 0 点赞 0 评论 188 浏览 评分:0.0
erase的大作用 摘要:#include<bits/stdc++.h> using namespace std; int main() { int t,i=0; cin>>t; while…… 题解列表 2024年07月31日 0 点赞 0 评论 129 浏览 评分:0.0
贼好用的erase,长也要记住 摘要:#include<bits/stdc++.h> using namespace std; int main() { string str; char t; cin>…… 题解列表 2024年07月31日 0 点赞 0 评论 103 浏览 评分:0.0
1119: C语言训练-"水仙花数"问题1 摘要:```cpp #include using namespace std; int a,b,c; int sxh(int n) { a=n/100; b=n/10%10; c=n%…… 题解列表 2024年07月30日 0 点赞 0 评论 240 浏览 评分:0.0
1023: [编程入门]选择排序 摘要:```cpp #include using namespace std; int k; int xz(int a[10]){ for(int i=0;ia[i]; xz(a); f…… 题解列表 2024年07月30日 0 点赞 0 评论 365 浏览 评分:10.0
1131: C语言训练-斐波纳契数列 摘要:```cpp #include using namespace std; int a[40]; int fbnq(int n){ a[0]=1,a[1]=1; for(int i=2;…… 题解列表 2024年07月30日 1 点赞 0 评论 203 浏览 评分:0.0
1852: 求1+2+3+...+n的值 摘要:解题思路:用for循环,从1累加到n。注意事项:n<=1000000000,变量得开long long。参考代码:#include<bits/stdc++.h>using namespace std;…… 题解列表 2024年07月30日 0 点赞 0 评论 187 浏览 评分: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 评论 190 浏览 评分:0.0