Cod sursa(job #2204406)

Utilizator llama27Asd asd llama27 Data 15 mai 2018 18:15:10
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <stack>
#define MaxDim 120
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
	char s[300000];
	int Words = 0, Count = 0;
	while (in >> s)
	{
		bool ok = 0;
		for (int i = 0; i <= strlen(s); i++) {
			if ( isalpha (s[i]) ) {
				Count++; ok = 1;
			}
			else {
				if (ok) {
					ok = 0; Words++;

				}
			}
		}

	}
	out << Count / Words;
}