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