Cod sursa(job #2069367)
Utilizator | Data | 18 noiembrie 2017 13:00:58 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | evaluare_cex_sv_cls_x | Marime | 0.64 kb |
#include <fstream>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");
char s[10000000];
int tc,nrcuv;
int main()
{
int i;
in.getline(s,10000000);
while(s[0]!=NULL)
{
for(i=0;s[i]!=NULL;i++)
{
if(isalpha(s[i]))
{
nrcuv++;
while(isalpha(s[i]))
{
tc++;
i++;
}
}
}
s[0]=NULL;
in.getline(s,8400000);
}
if(nrcuv==0)
out<<0;
else
out<<tc/nrcuv;
return 0;
}