Pagini recente » Cod sursa (job #2008911) | Cod sursa (job #2701956) | Cod sursa (job #1029744) | Cod sursa (job #1280049) | Cod sursa (job #1599269)
#include <iostream>
#include <stdio.h>
#define MAX 20000004
using namespace std;
FILE *fin = fopen("text.in", "r");
FILE *fout = fopen("text.out", "w");
char t[20000004];
int main() {
fread(t, 1, MAX, fin);
long i = 0;
bool c = false;
int ln = 0;
int tot = 0;
int am = 0;
while(t[i] != '\0') {
if((t[i] >= 'a' && t[i] <= 'z') || (t[i] >= 'A' && t[i] <= 'Z')) {
tot++;
c = true;
} else {
if(c)
am++;
c = false;
}
i++;
}
fprintf(fout, "%d", tot/am);
}