Cod sursa(job #150145)
| Utilizator | Data | 6 martie 2008 17:16:04 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<stdio.h>
#include<string.h>
char a[10000];
unsigned long n,l,c,l1,i;
int main()
{
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
while(f)
{
fgets(a,10000,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++;
}
}
if(c>0)
fprintf(g,"%d\n",l/c);
else
fprintf(g,"%d\n",0);
return 0;
}