Cod sursa(job #1131080)
Utilizator | Data | 28 februarie 2014 17:40:41 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <cstdio>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
unsigned long long total=0,cuvinte=0;
char x,y;
while(x!='\n')
{
scanf("%c",&x);
if(x=='\n') break;
else
{
if((x>='A'&&x<='Z')||(x>='a'&&x<='z'))
{
total++;
if(y==' ') {cuvinte++;y=x;}
}
else y=' ';
}
}
printf("%llu",total/cuvinte);
}