Cod sursa(job #482953)
| Utilizator | Data | 6 septembrie 2010 12:21:42 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.64 kb |
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
int main()
{
FILE *in = fopen("text.in", "r");
FILE *out = fopen("text.out", "w");
int c, tot = 0, cuv = 0;
bool isPrevLett = false;
do
{
c = getc(in);
if (c > 64 && c < 91 || c > 96 && c < 123)
{
tot++;
isPrevLett = true;
}
else
{
if (isPrevLett)
{
cuv++;
isPrevLett = false;
}
}
}
while (c != EOF);
fprintf(out, "%d", tot / cuv);
return 0;
}
