Cod sursa(job #911733)
| Utilizator | Data | 11 martie 2013 20:43:29 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char c; long nrl=0,nrc=0,aux=0;
while (f.get(c))
{
if ((c>='a'&& c<='z')||(c>='A' && c<='Z')) aux++;
else {
if (aux>0) nrc++;
nrl+=aux; aux=0;
}
}
g<<nrl/nrc;
f.close();g.close();
return 0;
}
