- [语言过关]最大最小数
123
- 2024-3-3 15:49:14 @
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n=0,max=0,min=0,mm=0,nn=0;
cin>>n;
for(int i=1;i<=n;i++)
{
int a=0;
cin>>a;
if(i==1)
{
max=a;
min=a;
mm=i;
nn=i;
}
if(max<a)
{
max=a;
mm=i;
}
if(min>a)
{
min=a;
nn=i;
}
}
printf("%d %d\n%d %d",max,mm,min,nn);
return 0; //程序结束,返回
}
0 comments
No comments so far...
Information
- ID
- 239
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 157
- Accepted
- 27
- Uploaded By