Cod sursa(job #1347714)
| Utilizator | Data | 19 februarie 2015 09:41:09 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include<fstream>
#include<cstdio>
using namespace std;
int main()
{ char c;
int ch=0,cuv=0;
FILE *in,*out;
in = fopen("text.in","r");
do {
c = getc (in);
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {
cuv++;
while((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {
ch++;
c = getc (in);
}
}
} while (c != EOF);
fclose(in);
out = fopen("text.out","w");
fprintf(out,"%d",ch/cuv);
fclose(out);
return 0;
}
