Cod sursa(job #481728)
| Utilizator | Data | 1 septembrie 2010 15:14:46 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.64 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int len,cuv,rez,sep;
char ch;
int main ()
{
f.get(ch);
while(!f.eof())
{
if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') )
{
len++;
if(!sep)
cuv++;
sep = 1;
}
else
sep = 0;
f.get(ch);
}
rez = len / cuv;
g << rez << '\n';
f.close();
g.close();
return 0;
}
