Cod sursa(job #488565)
Utilizator | Spatariu Mihai-Constantin myshu | Data | 29 septembrie 2010 11:41:05 |
---|---|---|---|
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 for(i=1;i<=1000000;i++);
return 0;
}