Cod sursa(job #488566)

Utilizator myshuSpatariu Mihai-Constantin myshu Data 29 septembrie 2010 11:42:53
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream.h>
#include<stdio.h>
int main ()
{
	ofstream fcout("text.out");
	FILE *f=fopen("text.in","r");
	int l2,lungime,cuv=0,i;
	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;}}
	if(cuv!=0)fcout<<lungime/cuv;
		else fcout<<0;
	fcout<<'\n';
	return 0;
}