Cod sursa(job #943594)
| Utilizator | Data | 25 aprilie 2013 22:02:20 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<stdio.h>
using namespace std;
char c;long int litere,cuvinte;bool sw;
int main()
{
FILE*fin=fopen("text.in","r");
while(fscanf(fin,"%c",&c)!=EOF)
{
if(((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
{
litere++;sw=1;
}
else if(sw==1){cuvinte++;sw=0;}
}
fclose(fin);
FILE*fout=fopen("text.out","w");
fprintf(fout,"%d",litere/cuvinte);
fclose(fout);
return 0;
}
