Cod sursa(job #459135)
Utilizator | Data | 27 mai 2010 22:24:16 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream.h>
#include<stdio.h>
int main ()
{
ofstream fcout("text.out");
FILE *f=fopen("text.in","r");
int l2,lungime,cuv=0;
char x='q';
lungime=0;l2=lungime;
while(x!='\n')
{fscanf(f,"%c",&x);
if(x<='z'&&x>='A')lungime++;
else if(l2!=lungime){cuv++;l2=lungime;}}
fcout<<lungime/cuv;
return 0;
}