题解列表

筛选

循环的方式求和Sn

摘要:解题思路:注意到22=2*10+2;222=22*10+2;因而可用双层for循环。注意事项:int sum 要定义到外层循环内部,保证每次循环时sum的初始值都是2.参考代码:#include<st……

1585:链表操作

摘要:```cpp #include using namespace std; typedef struct node { int shibu; int xubu; node* n……

1014: [编程入门]阶乘求和

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){    ll n,……

2825: 计算多项式的值

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){    ll n;……

C++使用Swap函数倒置字符串

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){    int num = 0;// 读入字符串长度    cin >……

to_string的大作用

摘要:参考代码:#include<bits/stdc++.h> using namespace std; #define int long long bool haoshu(int i) { s……

前缀和算法

摘要:参考代码:#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int n;……