Cod sursa(job #1144997)
Utilizator | Data | 17 martie 2014 19:47:21 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <stdio.h>
char c;
long cuv=1,l,q;
int main()
{
FILE*f1,*f2;
f1=fopen("text.in","r");
f2=fopen("text.out","w");
while(!feof(f1))
{
fscanf(f1,"%c",&c);
if(!feof(f1))
{
if(c=='-')if(q!=0)cuv++;
if(c==' ')if(q!=2)cuv++;
if(c>='a'&&c<='z')l++;
if(c>='A'&&c<='Z')l++;
if(c=='.')cuv++;
}
}
fprintf(f2,"%d",l/cuv);
return 0;
}