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