Mai intai trebuie sa te autentifici.
Cod sursa(job #444741)
Utilizator | Data | 21 aprilie 2010 15:19:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 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);
fclose(f);
fclose(g);
return 0;
}