Cod sursa(job #534723)
Utilizator | Data | 16 februarie 2011 08:51:12 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream>
#include <iomanip.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int i=1,ok,s,c=1;
char v;
int main ()
{while (!f.eof())
{f>> resetiosflags (ios::skipws) >>v;
if ((v>='A'&&v<='Z')||(v>='a'&&v<='z'))
{s=s+1;ok=1;}
else if (ok)
{c=c+1;ok=0;}}
g<<(s)/c;
}