Cod sursa(job #246494)

Utilizator ciorile.chioareBogatu Adrian ciorile.chioare Data 20 ianuarie 2009 22:12:56
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include<stdio.h>
#include<string.h>
#include<string>
#define N 1000000
char v[N];

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

void citire()
{
	for(int i=0;v[i];++i)
		scanf("%c",v[i]);
}



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;
}