Cod sursa(job #150142)
| Utilizator | Data | 6 martie 2008 17:11:30 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
#include<string.h>
char a[1000000];
unsigned long n,l,c,l1,i;
int main()
{
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
fgets(a,1000000,f);
n=strlen(a);
while(i<n)
{
l1=l;
while(i<n && (a[i]>='a' && a[i]<='z') || (a[i]>='A' && a[i]<='Z'))
{
l++;
i++;
}
if(l>l1)
c++;
i++;
}
fprintf(g,"%d\n",l/c);
return 0;
}