Cod sursa(job #237189)
Utilizator | Data | 29 decembrie 2008 11:13:01 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <stdio.h>
#include <fstream.h>
#include <ctype.h>
ifstream f("text.in");
ofstream g("text.out");
int s=0, c;
bool sw=0, swx;
char x;
int main()
{
while(!feof)
{
swx=0;
f>>x;
if (isalpha(x))
{
swx=1;
sw=1;
s++;
}
else
if (sw&&!swx)
{
sw=0;
c++;
}
}
g<<s/c;
return 0;
}