Cod sursa(job #1003974)
Utilizator | Data | 1 octombrie 2013 20:24:16 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<cstdio>
#include<ctype.h>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char ch;
int l,c,last;
l=c=0;
last=0;
while(scanf("%c",&ch)!=EOF)
{
if(isalpha(ch))
l++;
else
if(l>0 && ch!=',')
c++;
}
c--;
printf("%d",l/c);
return 0;
}