Pagini recente » Cod sursa (job #2691758) | Cod sursa (job #1620835) | Cod sursa (job #2150661) | Cod sursa (job #88062) | Cod sursa (job #627739)
Cod sursa(job #627739)
#include <cstdio>
#define DN 1024*1025
using namespace std;
char x[DN];
int main()
{
int nrcuv=0,nrlitere=0;
freopen("text.in","r", stdin);
freopen("text.out","w", stdout);
fgets(x,1000005,stdin);
bool ok=false;
for(int j=0;x[j]!=0;j++)
{
ok=false;
while((x[j]>='a' && x[j]<='z') || (x[j]>='A' && x[j]<='Z'))
{
nrlitere++;
j++;
ok=true;
}
if(ok==true) nrcuv++;
//if(x[j]=='!' || x[j]=='?' || x[j]=='.') break
}
printf("%d",nrlitere/nrcuv);
return 0;
}