Cod sursa(job #904767)
| Utilizator | Data | 4 martie 2013 20:38:05 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<iostream>
#include<stdio.h>
using namespace std;
int q,n,l,cuv,start;
int main()
{
FILE*f;f=fopen("text.in","rb");
while(!feof(f))
{
fscanf(f,"%c",&n);
if((n>=97 && n<=122)||(n>=65 && n<=90))
{
l++;
if(start==0)
start=1;
}
else
{
if(start)
{
start=0;
cuv++;
}
}
}
fclose(f);
if((n>=97 && n<=122)||(n>=65 && n<=90))
{
cuv++;
l=l-1;
}
FILE*g;g=fopen("text.out","wb");
fprintf(g,"%d",l/cuv);
}