题解列表

筛选

输入输出格式控制

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){    int a,b,c;    c……

C++实现贷款计算

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b;    float c;    cin>>a>>……

C++实现小数点控制

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<iomanip>using namespace std;int main(){    int a;    doubl……

求解长方形面积

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b;    cin>>a>>b;    cout<<……

1220题解 C++ 序列有序 新思路

摘要:解题思路: 1.把数直接插入原序列的末尾 2.然后用sort函数对新序列进行排序后再输出 注意事项: 利用sort函数要加algorithm的头文件 参考代码: ```cpp #incl……

二级c语言--求素数-c++

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std; int isprime(int n){  int c=0;  if(n==1)return ……
优质题解

1093: 字符逆序

摘要:解题思路:(1)利用反向迭代器reverse_iterator:rbegin() 和 rend(),比如:string str1("1234567890"); string str2(str1.rb……
优质题解

1097: 蛇行矩阵

摘要:解题思路:(1)建一个大小为 N 的二维数组。(2)定义一个计数器,每生成一节蛇就+1。(3)生成蛇的顺序是斜着、从行开始,比如蛇的第二条斜线,就是在 (1, 0) 和 (0, 1) 的位置按顺序生成……