- 求最小值(数组)
怎么取最小值
- 2024-5-19 11:27:48 @
帮帮孩子吧
4 条评论
-
lidongchen1 LV 6 @ 2024-9-21 15:11:04
#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ int n,minn=2000,maxn=-1; cin>>n; for(int i = 1;i<=n;i++){ cin>>a[i]; if(a[i]<minn){ minn = a[i]; } if(a[i]>maxn){ maxn = a[i]; } } cout<<minn; return 0; }
-
2024-7-14 15:09:34@
亲亲这边已经提交了题解,希望对亲亲能够有帮助,还恳请亲亲给个五星好评哦喵~
-
2024-6-9 21:55:53@
#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ int n,minn=2000,maxn=-1; cin>>n; for(int i = 1;i<=n;i++){ cin>>a[i]; if(a[i]<minn){ minn = a[i]; } if(a[i]>maxn){ maxn = a[i]; } } cout<<minn; return 0; }
-
2024-5-24 14:10:37@
qqqqqq
- 1
信息
- ID
- 2192
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 2
- 标签
- 递交数
- 286
- 已通过
- 149
- 上传者