Cod sursa(job #1825093)
Utilizator | Data | 8 decembrie 2016 18:44:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
long s=0,z=0,ok=1;
while(!f.eof())
{
char a;
f.get(a);
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
{
if(ok)
{
ok=0;
z++;
}
s++;
}
else
ok=1;
}
g<<s/z;
return 0;
}