Cod sursa(job #1084097)

Utilizator VisanCosminVisan Tudor Cosmin VisanCosmin Data 16 ianuarie 2014 18:45:58
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <stdio.h>

using namespace std;
char ch,ch1;
int c,z;
int main()
{
    FILE*f;
    f=fopen("text.in","r");
    while(!feof(f))
    {
        ch1=ch;
        fscanf(f,"%c",&ch);
        if((ch>=65&&ch<=90)||(ch>=97&&ch<=122)) z++;
        else if((ch1>=65&&ch1<=90)||(ch1>=97&&ch1<=122)) c++;
    }
    FILE*g;
    g=fopen("text.out","w");
    fprintf(g,"%d",z/c);
    fclose(g);
    fclose(f);

    return 0;
}