- [语言过关]求最大值、最小值
1234567890
- 2023-9-2 15:50:47 @
#include <bits/stdc++.h> using namespace std; int main() { int n,a,b; cin>>n; for(int i=1;i<=n;i++) { int c; cin>>c; if(i==1) { a=c; b=c; } else if(a<c) { a=c; } else if(b>c) { b=c; } } cout<<a<<" "<<b; return 0; }
1 comments
-
钱瑨 LV 7 @ 2023-9-2 16:08:48
???
- 1
Information
- ID
- 237
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 166
- Accepted
- 35
- Uploaded By