优化求解---第n小的质数 摘要:注意事项:优化求解过程。优化1:第二层for循环中的sqrt(i),因数都是成对出现的。比如,100的因数有:1和100,2和50,4和25,5和20,10和10。看出来没有?成对的因数,其中一个必然…… 题解列表 2022年11月27日 0 点赞 0 评论 510 浏览 评分:0.0
常规解法级数求和 摘要:结果:i = 1835421 Sn = 15.000000参考代码:#include<stdio.h>int main() { int k; double Sn = 0; scanf("%d",&k)…… 题解列表 2022年11月27日 0 点赞 0 评论 422 浏览 评分:0.0
自定义函数之字符串反转 摘要:解题思路:最简洁注意事项:参考代码:#include<stdio.h>#include<string.h>int fun(char a[]){ int n = strlen(a); return n;…… 题解列表 2022年11月27日 0 点赞 0 评论 264 浏览 评分:9.9
矩阵转换(矩阵转换) 摘要:解题思路:将原先的m行n列,变为n行m列。感谢大佬的思路,我真是个天才注意事项:参考代码:#includeint main(){ int i,j,m,n; int a[500][500]; scanf…… 题解列表 2022年11月27日 0 点赞 0 评论 598 浏览 评分:9.3
入门难度的题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int num[30];int maxnum;int main(){ stri…… 题解列表 2022年11月27日 0 点赞 0 评论 755 浏览 评分:9.9
计算矩阵边缘元素之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[500][500]; int i,j,m,n; int sum=0; scanf("%d %d",&…… 题解列表 2022年11月27日 0 点赞 0 评论 393 浏览 评分:0.0
二级C语言-进制转换 %o解法与通解 摘要:第一种解法,直接用printf的%o格式打印。 ```c #include int main(){ int n; scanf("%d",&n); printf("%…… 题解列表 2022年11月27日 0 点赞 0 评论 525 浏览 评分:9.9
2779: 输出绝对值 摘要:解题思路: 这道题考察的是条件语句的应用注意事项:参考代码:a = float(input())if a >= 0: print('{:.2f}'.format(a)) #第一…… 题解列表 2022年11月27日 0 点赞 0 评论 730 浏览 评分:2.0
跟原先不使用函数一样的道理-C语言解决 摘要:解题思路:注意事项:参考代码:#include<stdio.h> void max(int a, int b, int c) { int max = 0; if (a > b) ma…… 题解列表 2022年11月27日 0 点赞 1 评论 538 浏览 评分:9.9
Huffuman树 不需用删除,不需要额外空间。 摘要:解题思路:利用vector容器灵活性,可以自由添加数据,先对vector容器排序,取第一个和第二个数相加加入容器中,第一个和第二个数变为无穷大,不需用删除第一个第二个数,也不需要在开辟一个数组或者容器…… 题解列表 2022年11月27日 0 点赞 0 评论 519 浏览 评分:9.9