Cod sursa(job #1114401)
Utilizator | Data | 21 februarie 2014 16:27:42 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Probleme 1 | Marime | 0.4 kb |
#include<fstream>
#include<cstring>
using namespace std;
int ok,k,z;
int main()
{
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;
}