Cod sursa(job #179853)
Utilizator | Data | 16 aprilie 2008 13:35:17 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream.h>
#include<stdio.h>
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char x;
int c=0,nr_l=0,nr_c=0;
fin.get(x);
do
{
if (x==' ')
{
nr_c+=c;
c=0;
}
else
{
c=1;
nr_l+=(x>='A' && x<='Z' || x>='a' && x<='z');
}
}
while (fin.get(x));
nr_c+=c;
fout<<nr_l/nr_c;
fin.close();
fout.close();
return 0;
}