题解列表

筛选

1131: C语言训练-斐波纳契数列

摘要:这里采用的是循环方案,也可以用递归。#include<bits/stdc++.h> using namespace std; int main(){     int n;     cin ……

2644: 烤干机 c++分治思想

摘要:解题思路:这道题第一眼会想到全排列或者优先队列毫无疑问这是错的,因为时间复杂度太高了所以我想的是分治算法(因为最近比较菜想了好久)int f[500002];定义数组 int a(即A),b(即B)首……

1206: 字符串问题

摘要:这题就是字符串逆序,使用 reverse 函数。#include<bits/stdc++.h> using namespace std; int main(){     string s; ……

1093: 字符逆序

摘要:直接用 reverse 函数将字符串逆序。#include <bits/stdc++.h> using namespace std; int main() {     string s; ……

1083: Hello, world!

摘要:直接用 %c 输出 ASCII 码对应的字符,注意读入换行符时输出空格。#include <bits/stdc++.h> using namespace std; int main() { ……

1057: 二级C语言-分段函数

摘要:输出两位有效数字还是用 printf 方便。#include <bits/stdc++.h> using namespace std; int main() {     double x;……