Cod sursa(job #1131543)
| Utilizator | Data | 28 februarie 2014 21:24:17 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<cstdio>
#define InFile "text.in"
#define OutFile "text.out"
using namespace std;
unsigned int lit,cuv;
char k;
bool ok;
int main()
{
FILE *f=fopen(InFile,"r");
FILE *g=fopen(OutFile ,"w");
while(k!='\n')
{
fscanf(f,"%c",&k);
while(k>='a'&&k<='z'||k>='A'&&k<='Z')
{
lit++;ok=true;
fscanf(f,"%c",&k);
}
if(ok)cuv++,ok=false;
}
fprintf(g,"%d",lit/cuv);
return 0;
}
