Cod sursa(job #1309489)
Utilizator | Data | 5 ianuarie 2015 19:46:52 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lmax,nr;
char c;
int main()
{
f.get(c);
bool ok=0;
while(!f.eof())
{
if((c>='a' && c<='z')||(c>='A' &&c<='Z'))
{
lmax++;
ok++;
}
else if(ok)
{
nr++;
ok=0;
}
f.get(c);
}
g<<lmax/nr;
g.close();
return 0;
}