Cod sursa(job #1874692)
Utilizator | Data | 10 februarie 2017 12:36:42 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <fstream>
#include <strings.h>
#include <iostream>
#include <ctype.h>
using namespace std;
int main()
{
ifstream f("enunt.in");
ofstream g("enunt.out");
unsigned int x=0,i,S=0,k=0;
char s[100];
while (!f.eof())
{
f.get(s,99);
for (i=0;i<strlen(s);i++)
{
if (isalpha(s[i])!=0)
{
S++;
k++;
}
else
{
if (k!=0)
{
x++;
k=0;
}
}
}
f.get();
}
cout << S/x;
return 0;
}