Cod sursa(job #1197972)
| Utilizator | Data | 14 iunie 2014 11:10:43 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <cstdio>
#include <ctype.h>
using namespace std;
FILE *f, *g;
int main()
{
int cuv=0, lit=0;
char c1=' ';
char c2;
f = fopen("text.in", "r");
g = fopen("text.out", "w");
while(!feof(f))
{
fscanf(f, "%c", &c2);
if(isalpha(c2))
{lit++;
if(!isalpha(c1))
cuv++;}
c1=c2;
}
fprintf(g, "%d", lit/cuv);
return 0;
}
