Cod sursa(job #524563)
| Utilizator | Data | 22 ianuarie 2011 13:34:45 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<cstdio>
//#include<cstring>
char v[20]={' ',',','.','-','!','?'};
bool comp(char x)
{
int i;
for(i=0;i<=5;i++)
if(v[i]==x)
return false;
return true;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nrcuv=0,nrtxt=0;
char a,b;
scanf("%c",&a);
while (scanf("%c",&b)!=EOF)
{
if(comp(a)==true)
{
if(comp(b)==false)
nrcuv++;
nrtxt++;
}
a=b;
}
printf("%d",nrtxt/nrcuv);
return 0;
}