Cod sursa(job #1979510)
Utilizator | Data | 10 mai 2017 19:15:26 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
unsigned long long ltotal, nrc;
char s[400005];
int main()
{
int i, l;
fin.getline(s,sizeof(s));
l=strlen(s);
for(i=0; i<l; i++)
if(isalpha(s[i]))
{
nrc++;
while(isalpha(s[i]))
{
ltotal++;
i++;
}
}
fout<<ltotal/nrc<<'\n';
return 0;
}