Cod sursa(job #672762)

Utilizator Xavierpana emil Xavier Data 3 februarie 2012 01:40:02
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include<iostream>
#include<fstream>
using namespace std;

ifstream ifile;
ofstream ofile;
int c=0,k=0,ok=0;
char cr;

int main(){
    ifile.open("text.in");
    ofile.open("text.out");
    
    cr = ifile.get();
    
    while(cr!=EOF){

        if((cr>='A' && cr<='Z') || (cr>='a' && cr<='z')){ c++; if(!ok){ ok = 1; k++; }}
        else { ok = 0; }
        cr = ifile.get();
    }
    
    ofile<<c/k; //media
    
    ifile.close();
    ofile.close();
    system("PAUSE");
    return 0;
}