1139-求素数问题(代码短,思路容易理解) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int n,flag; ci…… 题解列表 2022年10月08日 0 点赞 0 评论 292 浏览 评分:0.0
1138-求矩阵的两对角线上的元素之和(代码短,思路容易理解) 摘要:解题思路:注意事项:参考代码:/*1) 矩阵的两条对角线:主对角线:左上到右下副对角线:右上到左下2) 行数和列数相等的矩阵叫作方阵3) 方阵的特点(假定下标从0开始):特点一:主对角线上的元素的行标…… 题解列表 2022年10月08日 0 点赞 0 评论 354 浏览 评分:0.0
1137-求函数值(代码短,思路容易理解) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int fun(int n){ if(n==1) return 10; …… 题解列表 2022年10月08日 0 点赞 0 评论 296 浏览 评分:0.0
1136-求具有abcd=(ab+cd)2性质的四位数(代码短,思路容易理解) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int c; for(int i=1000;i<100…… 题解列表 2022年10月08日 0 点赞 0 评论 266 浏览 评分:0.0
sort排序解决选择排序 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a[15]; for(int i=0;i…… 题解列表 2022年10月08日 0 点赞 0 评论 225 浏览 评分:0.0
1135-求s=a+aa+aaa+aaaa+aa...a的值(代码短,思路容易理解) 摘要:解题思路:注意事项:参考代码:/*将a,aa,aaa,...看作一个数列,该数列的特点:从数列的第二项开始,每一项与它的前一项的关系为:*10+a。 */#include<iostream>using…… 题解列表 2022年10月08日 0 点赞 0 评论 370 浏览 评分:0.0
1140-求车速(reverse()函数) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>#include<algorithm>using namespace std;int main(){…… 题解列表 2022年10月08日 0 点赞 0 评论 313 浏览 评分:0.0
1140-C语言训练-求车速 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>using namespace std;int main(){ int m=95860; while…… 题解列表 2022年10月08日 0 点赞 0 评论 279 浏览 评分:0.0
1133-求1+2!+3!+...+N!的和 摘要:解题思路:注意事项:参考代码:/*1)20的阶乘:243 2902 0081 7664 0000 (19位) 超出了int类型的最大范围,所有阶乘的结果用long long型变量存储。 2)long …… 题解列表 2022年10月08日 0 点赞 0 评论 291 浏览 评分:0.0
1134-C语言训练-求PI 摘要:解题思路:注意事项:参考代码:/*pi的计算公式:pi/4=1-1/3+1/5-1/7+...1) 控制每一项的正负:方法一: k=1;k*=-1;方法二: k=0;pow(-1,k); 2) 控制每…… 题解列表 2022年10月08日 0 点赞 0 评论 483 浏览 评分:0.0