Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- problema 98
- #include <fstream>
- using namespace std;
- ifstream fin("maxim4.in");
- ofstream fout("maxim4.out");
- int main()
- {
- int v[100],n,c=0,mx=-1001,i;
- fin>>n;
- for (i=0;i<n;i++)
- fin>>v[i];
- for (i=0;i<n;i++){
- if (v[i]>mx){
- mx=v[i];
- c=0;
- }
- if (v[i]==mx)
- c++;
- }
- fout<<mx<<' '<<c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement