Pagini recente » Cod sursa (job #3182313) | Cod sursa (job #2556452) | Cod sursa (job #978499) | Cod sursa (job #89923) | Cod sursa (job #1090715)
Utilizator |
Ovidiu ovidel95 |
Data |
22 ianuarie 2014 23:21:23 |
Problema |
Text |
Scor |
90 |
Compilator |
cpp |
Status |
done |
Runda |
exemplu1 |
Marime |
0.61 kb |
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char s;
int nrlit=0,nrcuv=0,k;
while(scanf("%c",&s)!=EOF)
{
if((s>='a'&&s<='z')||(s>='A'&&s<='Z'))
{
nrlit++;
k=0;
}
else
if(k==0)
{
nrcuv++;
k=1;
}
}
if(nrcuv==0)
printf("0");
else
printf("%d",nrlit/nrcuv);
fclose(stdin);
fclose(stdout);
return 0;
}