Cod sursa(job #237191)
Utilizator | Data | 29 decembrie 2008 11:14:42 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 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(f>>x)
{
swx=0;
if (isalpha(x))
{
swx=1;
sw=1;
s++;
}
else
if (sw&&!swx)
{
sw=0;
c++;
}
}
g<<s/c;
return 0;
}