Cod sursa(job #1207198)
Utilizator | Data | 12 iulie 2014 15:08:09 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char c;
int ok=0,nr=0,lungime=0;
while(f>>noskipws>>c)
{
if(isalpha(c))
{
lungime++;
if(ok==0)
{
nr++;
ok=1;
}
}
else
ok=0;
}
g<<lungime/nr;
return 0;
}