Cod sursa(job #1109304)
Utilizator | Data | 16 februarie 2014 22:51:17 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{int ok=0,k=0,i,z=0;
char s;
ifstream f("text.in");
ofstream g("text.out");
while(f.get(s))
{
{if((s>='a'&&s<='z')||(s>='A'&&s<='Z'))
k++;
else
{if(k)
ok++;
z=z+k;
k=0;}
}
}
g<<z/ok;
f.close();
g.close();
return 0;
}