Cod sursa(job #2455698)
Utilizator | Data | 12 septembrie 2019 15:25:49 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char lit;
int l, ok, nr, sum;
int main()
{
while(!f.eof())
{
lit=f.get();
if(lit>='a' && lit<='z' || lit>='A' && lit<='Z')
{
l++;
ok=1;
}
else
{
if(ok==1)
nr++;
sum+=l;
ok=0;
l=0;
}
}
g<<sum/nr;
return 0;
}