Cod sursa(job #2274138)
Utilizator | Data | 1 noiembrie 2018 14:13:41 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <bits/stdc++.h>
using namespace std;
char ch[1000999];
int words,no;
int main()
{
ifstream fin ("text.in");
ofstream fout ("text.out");
fin.getline(ch,1000099);
int n=strlen(ch);
for (int i=0;i<n;++i)
{
if (isalpha(ch[i]))
{
words++;
while (isalpha(ch[i]) && i<n)
{
no++;
++i;
}
}
}
fout<<no/words<<"\n";
return 0;
}