Cod sursa(job #1087624)
Utilizator | Data | 19 ianuarie 2014 17:23:29 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;
int nr,tot,ok;
char ch;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c", &ch)!=EOF)
{
if(isalpha(ch)){
tot++;
if(!ok){
nr++;
ok=1;
}
}
else ok=0;
}
printf("%d",tot/nr);
return 0;
}