Pagini recente » Cod sursa (job #2599354) | Cod sursa (job #2860155) | Cod sursa (job #1628810) | Cod sursa (job #1977365) | Cod sursa (job #93609)
Cod sursa(job #93609)
#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;
}