Cod sursa(job #2069114)
Utilizator | Data | 18 noiembrie 2017 12:01:58 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s [8001];
int lungime = 0, numarCuv = 0, n;
while (f >> s){
numarCuv++;
n = strlen(s);
for (int i = 0; i < n; i++)
if (isalpha(s[i]))
lungime++;
}
g << lungime/ numarCuv;
return 0;
}