Cod sursa(job #865957)

Utilizator RaduGabriel2012Dinu Radu RaduGabriel2012 Data 27 ianuarie 2013 12:58:24
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c;
int word=0,i,ch=0,prev=0;
int main()
{
while(f.eof())
{f>>c;
if ((c>=65 && c<=90)||((c>=97)&&(c<=122))) {ch++;prev=1;}
else if (prev) {word++;prev=0;}
}
if (prev) word++;
g<<ch/word;
return 0;
}