Cod sursa(job #93609)
| Utilizator | Data | 19 octombrie 2007 16:30:23 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream.h>
#include <string.h>
#include <iomanip.h>
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char text[200];
int l, cuv, t;
cuv = 0;
l=0;
int i=0;
while (!fin.eof())
{
fin>>resetiosflags(ios::skipws)>>text[i];
if (text[i]>='a' && text[i]<='z' || text[i]>='A' && text[i]<='Z')
l++;
if (text[i] == ' ')
cuv++;
i++;
}
cuv++;
t = l/cuv;
fout<<t<<'\n';
return 0;
}