Cod sursa(job #1363440)

Utilizator george.buneaFMI George Bunea george.bunea Data 26 februarie 2015 23:05:32
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>
#include <string.h>
#include <conio.h>
#include <cstdio>
using namespace std;

int main(){
    ifstream f("text.in");
    ofstream g("text.out");
    char s;

    int sum=0,nr=0,i,al=0,k=1;

    i=0;
    while(!f.eof()){
        f.get(s);
        if(isalpha(s))
            k=0,nr++;

        else if(k==0)
            al++,k=1;

        i++;

    }

    g<<nr/al;


    return 0;
}