![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数组问题
no_obstacles
no talent ,but work hard
展开
-
合唱队形-数组问题
输入: 7 154 160 157 162 159 152 163 输出: 152 157 160 163 162 159 154 代码: #include <bits/stdc++.h> using namespace std; int n; int a[60],b[60]; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+n+1)...原创 2022-04-01 10:31:40 · 68 阅读 · 0 评论 -
数组:找四个连续下标的最大值
输入: 20 11 19 9 12 5 20 1 18 4 16 6 10 15 2 17 3 14 7 13 8 输出: 51 1 代码实现: #include <bits/stdc++.h> using namespace std; int main(){ int i,n,x=INT_MIN,t=0,r; int a[21]; cin>>n; for(i=0;i<n;i++){ cin>>a[i]; } for(i...原创 2022-03-30 15:29:00 · 289 阅读 · 3 评论