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