Cod sursa(job #326301)
| Utilizator | Data | 24 iunie 2009 15:50:51 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<stdio.h>
using namespace std;
int main()
{
FILE *f=fopen("text.in","r"), *g=fopen("text.out","w");
int cuvinte=0,ok=0,cuv=1;
char c;
while(c!='\n')
{fscanf(f,"%c",&c);
if( ( ( (int) c < 65 ) || ( (int)c > 122 ) ) || ( ( (int) c < 97) || ( (int) c > 122 ) ) )
{
if(ok==1)
cuvinte++;
ok=0;
}
else {ok=1;cuv++;} }
fprintf(g,"%d\n",cuv/cuvinte);
fclose(f);
fclose(g);
return 0;}