Cod sursa(job #987698)
| Utilizator | Data | 21 august 2013 13:01:55 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | clasele_5_6 | Marime | 0.46 kb |
#include<iostream>
using namespace std;
#include<stdio.h>
FILE *f,*g;
char u;
int lungime,litere,x;
int main()
{
f=fopen("text.in","r");
g=fopen("text.out","w");
while(!feof(f))
{
fscanf(f,"%c",&u);
if((u>='a'&&u<='z')||(u>='A'&&u<='Z'))
lungime++;
else
{if(lungime>0)
litere++;
x=x+lungime;
lungime=0;
}
}
fprintf(g,"%d",x/litere);
}
