Cod sursa(job #246492)

Utilizator ciorile.chioareBogatu Adrian ciorile.chioare Data 20 ianuarie 2009 22:10:27
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.59 kb
#include<stdio.h>
#include<string.h>
#include<string>

char v[500000];

int m=0,k,a,count=0;

void citire()
{
	gets(v);
}



int spat(int &c)
{
	int i=0;
	while(v[i]!='\0')
	{
		if( ( (v[i]>=65)&&(v[i]<=90) )||( ( v[i]>=97 )&&( v[i]<=122 ) ) )
		{
			c++;
		}
		
		if( ( ( (v[i]>=65)&&(v[i]<=90) )||( ( v[i]>=97 )&&( v[i]<=122 ) ) )&&( ( v[i+1]<65 )||( (v[i+1]>90)&&(v[i+1]<97) ) ))
		{
			count++;
		}
		i++;
	}
    return count;
}


int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
   
    citire();
   
    int x=spat(m);
    printf("%d",m/x);

	return 0;
}