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