Cod sursa(job #323065)
Utilizator | Data | 10 iunie 2009 17:11:30 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.59 kb |
#include<cstdio>
#include<cstring>
#define maxn 1000007
using namespace std;
char a[maxn];
int i,n,p,k;
int ch(char x)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
return 1;
return 0;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(a,sizeof(a),stdin);
n=strlen(a);
for(i=0;i<=n;++i)
if(ch(a[i]))
++k;
else
if(i)
if(ch(a[i-1]))
++p;
printf("%d\n",k/p);
fclose(stdin);
fclose(stdout);
return 0;
}