1 by arhiplupuzait

VIEWS: 31 PAGES: 1

									#include <fstream.h> #include <conio.h> #include <iomanip.h> int a[100],n; void main(){ cout<<"n="; cin>>n; for(int i=1;i<=n;i++){ cout<<"nota "<<i<<"="; cin>>a[i]; } int max=a[1],min=a[1]; float s=0; for(i=1;i<=n;i++){ if(a[i]>max) max=a[i]; if(a[i]<min) min=a[i]; s+=a[i]; } s=s-max-min; cout<<"media este "<<s/(n-2)<<setprecision(2); }


								
To top