Cod sursa(job #940953)
Utilizator | Data | 17 aprilie 2013 16:40:44 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<fstream>
#include<cstdio>
using namespace std;
char x;
long nr,sp,med;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
x=f.get();
while(!f.eof())
{
if((x>='A'&&x<='Z')||(x>='a'&&x<='z'))
nr++;
else
if(x==' '||x=='-')
sp++;
x=f.get();
}
med=nr/sp;
g<<med;
return 0;
}