Pagini recente » Schimbarea compilatoarelor Borland la OJI | Cod sursa (job #1566387) | Cod sursa (job #361337) | Cod sursa (job #1996162) | Cod sursa (job #1385339)
#include <cstdio>
#include <cctype>
#include <cstring>
#define nmax 1000000
using namespace std;
char s[nmax], *p, sep[]=" +-,.?!1234567890;", s1[nmax];
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
int n, i, nrcuv=0, nrl=0;
gets(s);
n=strlen(s);
strcpy(s1, s);
p=strtok(s, sep);
while(p)
{
nrcuv++;
p=strtok(NULL, sep);
}
for(i=0;i<n;i++)
{
if(islower(s1[i])!=0||isupper(s1[i])!=0)
nrl++;
}
printf("%d\n", nrl/nrcuv);
return 0;
}