Cod sursa(job #1324575)
Utilizator | Data | 22 ianuarie 2015 15:59:34 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char t;
int ok=0,len=0,cuv=0;
while (!f.eof())
{f.get(t);
if((t>='a'&&t<='z')||(t>='A'&&t<='Z'))
{len++;
ok=1;
}
else{ if (ok)cuv++;ok=0;}
}
g<<len/cuv;
return 0;
}