Cod sursa(job #568797)
| Utilizator | Data | 31 martie 2011 18:17:25 | |
|---|---|---|---|
| Problema | Operatii | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
const char iname[] = "operatii.in";
const char oname[] = "operatii.out";
ifstream fin(iname);
ofstream fout(oname);
int mx, ct, i, a[1000005], n;
int main()
{
fin >> n;
for(i = 1; i <= n; i ++)
{
fin >> a[i];
if(a[i] > mx)
mx = a[i];
if(a[i] == 0)
++ct;
}
fout << mx + ct << "\n";
return 0;
}