Cod sursa(job #573176)
Utilizator | Data | 5 aprilie 2011 23:21:20 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream.h>;
#include <stdio.h>;
using namespace std;
char ch;
int a,b,c;
short k;
int main()
{
freopen("text.in","r",stdin);
while ( scanf("%c",&ch) == 1 )
{
if ((( ch >= 'A') && ( ch <= 'Z' )) || (( ch >= 'a' ) && ( ch <= 'z' )))
{
k = 1;
a++;
}
else if ( k == 1 )
{
k = 0;
b++;
}
}
if ( k == 1 ) b++;
c = a/b;
freopen("text.out","w",stdout);
printf("%d", c);
fclose(stdout);
fclose(stdin);
return 0;
}