Cod sursa(job #373048)

Utilizator Robyy14Rusu Andrei Robert Robyy14 Data 12 decembrie 2009 15:16:25
Problema Text Scor 0
Compilator c Status done
Runda Arhiva de probleme Marime 0.47 kb
#include<cstdio>
#include<cctype>
#include<string>

using namespace std;

unsigned int i,l,c;
char txt[500];
FILE *infile;
FILE *outfile;
int main(){
    infile = fopen("text.in", "r");
    outfile = fopen("text.out", "w");

    while(!EOF){
          txt[1] = fgetc (infile);
          if (isalpha(txt[1])){
              c++;
              l+=strlen(txt);
          }
    }
    l=l/c;
    fprintf (infile, "%d", l);

fclose(infile);fclose(outfile);

}