Cod sursa(job #2343869)
Utilizator | Data | 14 februarie 2019 13:54:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <stdio.h>
using namespace std;
FILE *f,*g;
int main()
{
int c1,c2,ok;
char c;
f=fopen("text.in","r");
g=fopen("text.out","w");
c1=c2=0;
ok=1;
while(c!='\n')
{
fscanf(f,"%c",&c);
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
if(ok!=0)
c2++;
c1++;
ok=0;
}
else
ok=1;
}
c1/=c2;
fprintf(g,"%d",c1);
return 0;
}