Cod sursa(job #175400)
| Utilizator | Data | 9 aprilie 2008 21:48:09 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
long long x,y;
int main()
{char c,s;
FILE*f=fopen("text.in","r");
FILE*g=fopen("text.out","w");
fscanf(f,"%c",&c);
if(c>='a'&&c<='z'||c>='A'&&c<='Z') x++;
s=c;
while(!feof(f))
{fscanf(f,"%c",&c);
if(c>='a'&&c<='z'||c>='A'&&c<='Z') x++;
else if(s>='a'&&s<='z'||s>='A'&&s<='Z') y++;
s=c;}
fprintf(g,"%lld",(x-1)/(y+1));
fcloseall();
return 0;
}