Cod sursa(job #466001)
| Utilizator | Data | 25 iunie 2010 17:44:31 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <stdio.h>
#include <fstream>
using namespace std;
int L, CUV;
char X, Xa;
int ch (int C) {
return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z');
}
int main () {
ifstream fin ("text.in");
ofstream fout ("text.out");
while (fin.get(X)) {
if (ch (X)) {
++L;
if (!ch (Xa)) ++CUV;
}
Xa = X;
}
fout << L / CUV;
return 0;
}
