Cod sursa(job #964984)
Utilizator | Data | 22 iunie 2013 21:16:53 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char n;
int litere,cuvinte,t=0;
int main()
{ while(f.get(n))
{ if(('a'<=n && n<='z')||('A'<=n && n<='Z'))
litere++;
else
{
if(lit) cuvinte++;
t+=litere;
litere=0; }
}
g<<t/cuvinte;
return 0;
}