Cod sursa(job #2204318)
Utilizator | Data | 15 mai 2018 13:57:15 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
char s[300000];
int Word=0,Count=0;
while(in>>s)
{
bool ok=0;
for(int i=0;i<=strlen(s);i++){
if(isalpha(s[i])){
Count++;ok=1;
}
else{
if(ok){
ok=0;Word++;
}
}
}
}
out<<Count/Word;
}