Cod sursa(job #604199)
Utilizator | Heidelbacher Andrei a_h1926 | Data | 20 iulie 2011 20:08:59 |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <iostream>
using namespace std;
long long L, NWords;
void Read ()
{
freopen ("text.in", "r", stdin);
char A, B;
scanf ("%c%c", &A, &B);
while (B!='\n')
{
if ((A>='a' and A<='z') or (A>='A' and A<='Z'))
{
++L;
if ((B>='a' and B<='z') or (B>='A' and B<='Z'));
else
{
++NWords;
}
}
A=B;
scanf ("%c", &B);
}
}
void Print ()
{
freopen ("text.out", "w", stdout);
printf ("%d\n", L/NWords);
}
int main()
{
Read ();
Print ();
return 0;
}