Cod sursa(job #526275)
| Utilizator | Data | 27 ianuarie 2011 21:56:59 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <string>
using namespace std;
int main ()
{
string s, c="abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVWYZ";
bool cuvant=false;
int t=0,v=0,tf=0;
ifstream f ("Text.in");
ofstream g ("Text.out");
for (int i=0; !f.eof() ; i++)
{
s+=f.get();
if (c.find(s[i],0)!=string::npos)
cuvant=true;
else
{
cuvant=false;
if (t>0) v++;
tf+=t;
t=0;
}
if (cuvant==true)
{
t++;
}
}
g<<tf/v;
g.close();
return 0;
}