Cod sursa(job #444739)
Utilizator | Data | 21 aprilie 2010 15:18:26 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include "stdio.h"
#include "ctype.h"
int main()
{
int i=0,nrcuv=0,nrlit=0;
char ch=' ',chsecund=' ';
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
while(!feof(f)){
chsecund=ch;
ch=fgetc(f);
if(isalpha(ch)) nrlit++;
if(isalpha(chsecund)&& !(isalpha(ch))) nrcuv++;
}
fprintf(g,"%d",nrlit/nrcuv);
fcloseall;
return 0;
}