Cod sursa(job #702315)
Utilizator | Data | 1 martie 2012 20:57:37 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
#include<ctype.h>
#include<string.h>
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
int main()
{
char s[500000];
fscanf(f,"%s",&s);
int i,cuv=0,lit=0;
bool ok=1;
for (i=0;i<strlen(s);i++)
{
if (isalpha(s[i]))
{
ok=0;
lit++;}
else if (ok==0)
{
cuv++;
ok=1;
}
}
fprintf(g,"%d",lit/cuv);
return 0;
}