Pagini recente » Cod sursa (job #2428427) | Cod sursa (job #2123685) | Cod sursa (job #949806) | Cod sursa (job #858220) | Cod sursa (job #2221534)
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string.h>
#include <ctype.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char a[1000], mat[100][30], sep[] = "-., :!;?/'_<>()[]{}|#1234567890", *p;
int n = 0, total = 0;
int main()
{
fin.getline(a, 1000);
p = strtok(a, sep);
while (p)
{
strcpy(mat[n], p);
//cout << mat[n] << "\n";
//for (int i = 0; i<strlen(mat[n]); i++)
// if(isalpha(mat[n][i])) total++;
total += strlen(mat[n]);
n++;
p = strtok(NULL, sep);
}
//cout << total << " " << n << "\n";
fout << (total) / n;
system("pause");
return 0;
}