Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
82646 sh25_shenpy 最大的数及最小的数 C++ 编译错误 0 MS 0 KB 416 2026-01-16 18:36:58

Tests(0/0):


#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int s[n],t[n]; for(int x=0;x<n;++x){ cin>>s[x]; t[x]=s[x]; } sort(s,s+n); for(int y=0;y<n;++y){ if(t[y]==s[0]) const int b=y; if(t[y]==s[n-1]) const int a=y; } cout<<"max="<<s[n-1]<<" ("<<a<<")"<<endl; cout<<"min="<<s[0]<<" ("<<b<<")"; return 0; }


测评信息: