Run ID:77390
提交时间:2024-06-09 09:35:54
#include<iostream> #include<iomanip> using namespace std; int main(){ int a[1000] = {}; for(int i=0;i<=9;i++){ cin>>a[i]; } int mxx = 0,ndd =1000; int posm = 0,posn = 0; for(int i=0;i<=9;i++){ if(ndd > a[i]){ ndd = a[i]; posn = i; } if(mxx < a[i]){ mxx = a[i]; posm = i; } } cout<<posm+1<<" "<<mxx<<endl; cout<<posn+1<<" "<<ndd; }