Mai intai trebuie sa te autentifici.
Cod sursa(job #291446)
Utilizator | Data | 29 martie 2009 21:01:59 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | The Beginners | Marime | 0.64 kb |
#include<stdio.h>
#include<iostream>
#define N 10000000
using namespace std;
long long solve()
{
freopen("text.in","r",stdin);
int litere=0,cuvinte=0;
char ch,cch;
while(scanf("%c",&ch)!=EOF)
{
if((cch<'A' || cch>'Z' && cch<'a' || cch>'z') && (ch>='A' && ch<='Z' || ch>='a' && ch<='z'))
{
++cuvinte;
++litere;
}
if((ch>='A' && ch<='Z' || ch>='a' && ch<='z') && (cch>='A' && cch<='Z' || cch>='a' && cch<='z'))
++litere;
cch=ch;
}
return litere/cuvinte;
}
void afisare()
{
freopen("text.out","w",stdout);
printf("%lld",solve());
}
int main()
{
solve();
afisare();
return 0;
}