Cod sursa(job #323069)
| Utilizator | Data | 10 iunie 2009 17:20:34 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include<cstdio>
#include<cstring>
#define maxn 2000007
using namespace std;
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
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()
{
fgets(a,sizeof(a),f);
n=strlen(a);
for(i=0;i<=n;++i)
if(ch(a[i]))
++k;
else
if(i)
if(ch(a[i-1]))
++p;
fprintf(g,"%d\n",k/p);
fclose(f);
fclose(g);
return 0;
}
