Cod sursa(job #1051169)
| Utilizator | Data | 9 decembrie 2013 19:39:58 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <string.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
FILE *in=fopen("text.in","r"),*out=fopen("text.out","w");
long long cr=0,cuv=0;
void _read()
{
char ch;
while(!feof(in))
{
fscanf(in,"%c",&ch);
if( strchr("!.? ,", ch )== NULL )
{
cuv++;
while( strchr("!.? ,",ch )== NULL &&!feof(in))
{
if( (ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
cr++;
fscanf(in,"%c",&ch);
}
}
}
}
int main()
{
_read();
fprintf(out,"%lld",cr/cuv);
return 0;
}
