Cod sursa(job #342277)
Utilizator | Data | 21 august 2009 10:41:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int sum,nr,i,ok;
char s;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
sum=nr=0;
ok=1;
for (; !feof(stdin);)
{
scanf("%c",&s);
s=toupper(s);
if (s<='Z' && s>='A'){
sum++;
if (ok) nr++;
ok=0;
}
else ok=1;
}
printf("%d\n",sum/nr);
return 0;
}