Cod sursa(job #1070028)
Utilizator | Data | 30 decembrie 2013 21:15:05 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include <ctype.h>
#include <cstring>
std::ifstream fin("text.in");
std::ofstream fout("text.out");
char c;
int len, cuv, k;
int main(){
while (!fin.eof()){
fin.get(c);
k = 0;
while (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'){
k = 1;
len++;
fin.get(c);
}
if (k == 1)
cuv++;
}
fout << len / cuv;
return 0;
}