Răspuns:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream in("maxim4.in");
ofstream out("maxim4.out");
int V[100],n,maxim,nrmaxim=0;
in>>n;
for(int i=0;i<n;i++) in>>V[i];
maxim=V[0];
for(int i=1;i<=n;i++) { if(V[i]>maxim) { maxim=V[i];
nrmaxim++;}}
out<<"nr maxim este:"<<maxim<<endl;
out<<"și apare de:"<<nrmaxim<<" "<<"ori";
in.close();
out.close();
return 0;}