Cod sursa(job #1151767)
Utilizator | Data | 24 martie 2014 12:50:04 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <stdio.h>
using namespace std;
int main()
{
FILE *fin,*fout;
fin=fopen("text.in","r");
fout=fopen("text.out","w");
char ch;
int c1=0,c2=0;
while(!feof(fin))
{
fscanf(fin,"%c",&ch);
if('a'<=ch&&'z'>=ch) c1++;
else if('A'<=ch&&'Z'>=ch) c1++;
else if(ch==' ') c2++;
}
c2++;
fprintf(fout,"%i",c1/c2);
}