Cod sursa(job #2040947)
Utilizator | Data | 16 octombrie 2017 18:42:26 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;
FILE *f,*g;
char *p,s[1000020];
int m,i,cuv,lit;
int main()
{
f=fopen("text.in","r");
g=fopen("text.out","w");
fgets(s,1000010,f);
while(s[i])
{
if(isalpha(s[i]))
{
cuv++;
while(isalpha(s[i]))
{
lit++;
i++;
}
}
i++;
}
m=lit/cuv;
fprintf(g,"%d\n",m);
return 0;
}