Cod sursa(job #1599269)
| Utilizator | Data | 13 februarie 2016 18:58:18 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#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);
}
