Cod sursa(job #1214902)
| Utilizator | Data | 31 iulie 2014 17:56:44 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
#include <cstring>
using namespace std;
FILE *f,*g;
char c;
bool litera(char c) {return(c>=65&&c<=90)||(c>=97&&c<=122);}
int main()
{ f=fopen("text.in","r");
g=fopen("text.out","w");
int ok=0,lit=0,cuv=0;
while (fscanf(f,"%c",&c)!=EOF)
{ if (litera(c))
{ lit++;
if (ok==0)
cuv++;
ok= 1;
}
else ok=0;
}
fprintf(g,"%d\n",lit/cuv);
return 0;
}
