用C语言for循环写蛇形矩阵解题(不用数组) 摘要:解题思路:(1)观察蛇形矩阵存在两个规律:①行和列都存在一个递增关系;②每行首数据可以用一个递增值加上一个值得到。 (2)可以先把每行首元素输出,在处理首元素后面的数据,第一…… 题解列表 2023年06月06日 0 点赞 0 评论 379 浏览 评分:9.9
普通的写法 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;const int N =10010;int a[N];…… 题解列表 2023年06月06日 0 点赞 0 评论 717 浏览 评分:0.0
C语言训练-求矩阵的两对角线上的元素之和 摘要:解题思路:#include<bits/stdc++.h>using namespace std;int main(){ int i,j,s=0; int n; int a[10][10]; cin>>…… 题解列表 2023年06月06日 0 点赞 0 评论 268 浏览 评分:0.0
C语言考试练习题_一元二次方程(C语言) 摘要://解一元二次方程ax^2+bx+c=0的解。 #include<stdio.h> #include<math.h> int main(){ double a,b,c; s…… 题解列表 2023年06月05日 0 点赞 0 评论 468 浏览 评分:9.9
A+B for Input-Output Practice (VI) 摘要:#include<stdio.h> int main(){ int a; int b; int sum = 0; while(scanf("%d",&a)!=EOF){ …… 题解列表 2023年06月05日 0 点赞 0 评论 355 浏览 评分:10.0
A+B for Input-Output Practice (V) 摘要:#include<stdio.h> int main() { int a; scanf("%d",&a); int sum = 0,c; int b[a][100]; f…… 题解列表 2023年06月05日 0 点赞 0 评论 312 浏览 评分:0.0
c++入门必写题 摘要:解题思路:标记一个数 如果是素数就为1,反之为0,后面二层循环出来为1就加注意事项:无参考代码:#include <bits/stdc++.h>using namespace std;int i,j,…… 题解列表 2023年06月05日 0 点赞 0 评论 414 浏览 评分:2.0
c语言代码解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>void CompactIntegers(int a[],int k,int n){ int i; for (i = k; …… 题解列表 2023年06月05日 0 点赞 0 评论 359 浏览 评分:0.0
c语言代码解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char str[1001]; gets(str); st…… 题解列表 2023年06月05日 0 点赞 0 评论 436 浏览 评分:0.0
不高兴的津津(C++实现,两种方法:vector容器和结构体数组) 摘要:解题思路:方法一:用两个vector容器,第一个存放对应日期的上课时间,再将第一个的上课时间大于8的元素存放到第二个vector容器中,对第二个容器进行升序排序操作,最后遍历第二个容器将容器出现的第一…… 题解列表 2023年06月05日 0 点赞 0 评论 813 浏览 评分:9.9