Cod sursa(job #2062214)
Utilizator | Data | 10 noiembrie 2017 08:45:45 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char c;
int nrc=0,con=0,s=0,ok=0;
while(fin.get(c))
{
if(isalpha(c)!=0)
{con++;ok=1;}
else
{
if(ok==1)
{
nrc++;
s=s+con;
con=0;
}
}
}
fout<<s/nrc;
return 0;
}